sqlserver创建远程查询

开始远程查询前:spa

----open:Ad Hoc Distributed Queries
EXEC sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
RECONFIGUREio

结束查询:dva

-----close:Ad Hoc Distributed Queries查询

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

 

 

示例:word

SELECT gsjc ,
companyid ,
gscause
FROM OPENDATASOURCE('SQLOLEDB',
'Data Source=120.76.233.81,5433;User ID=lq;Password=lq123!@#').KMSLEY.dbo.basCompanyco

相关文章
相关标签/搜索