SqlServer 跨服务器查询

查询语句

select * from openrowset( 'SQLOLEDB', 'IP'; 'sa'; '123' ,库名.dbo.表名)

 

开启 'Ad Hoc Distributed Queries'

exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

 

关闭

exec sp_configure 'show advanced options',0
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure

 

posted @ 2022-05-31 13:58  forwin  阅读(56)  评论(0)    收藏  举报