博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MSSQL跨服务器查询
阅读量:7257 次
发布时间:2019-06-29

本文共 376 字,大约阅读时间需要 1 分钟。

1.因为此功能服务器安全配置的一部分而被关闭,所以我们先开启

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

2.如果需要关闭,执行

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

3.查询语句

SELECT * FROM OPENDATASOURCE( 'SQLOLEDB', 'Data Source=远程IP地址;User ID=sa;Password=密码' ).数据库.dbo.表名

 

转载地址:http://shpdm.baihongyu.com/

你可能感兴趣的文章