SQL ServerSQL Server : 分布式查询

–创造链接服务器
exec sp_addlinkedserver ‘DBMap05′,”,’SQLOLEDB’,’192.168.0.5′

–创制登陆
exec sp_addlinkedsrvlogin @rmtsrvname = ‘DBMap05’
, @useself = ‘false’
, @locallogin = null
, @rmtuser = ‘sa’
, @rmtpassword = ‘sa’

–查询示例
select * from DBMap05.Test.dbo.Person

相关文章