开始远程查询前:

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

结束查询:

-----close:Ad Hoc Distributed Queries

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

 

 

示例:

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

 

相关文章:

  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2021-12-07
  • 2022-12-23
猜你喜欢
  • 2021-07-03
  • 2021-12-05
  • 2021-12-11
  • 2021-06-16
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案