建立连接服务器,然后用 servername.dataname.owner.tablename 访问
或者用OPENDATASOURCE如:
SELECT *
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=192.168.0.5;User ID=sa;Password=123'
).Northwind.dbo.Categories
或者用OPENDATASOURCE如:
SELECT *
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=192.168.0.5;User ID=sa;Password=123'
).Northwind.dbo.Categories
请问楼上的大哥:我在存储过程中使用你的语句出现以下的错误是什么意思:Error 7405: Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.
---------------------------
exec sp_addlinkedserver 'csj2008','','SQLOLEDB','CSJ'
exec sp_addlinkedsrvlogin 'csj2008','false',null,'MIS','MIS'
select * from csj2008.生产系统.dbo.原料仓_库存资料