------------------------------------------------------------
--这段先执行
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
------------------------------------------------------------

 

 

--这里写要执行的SQL语句
select *
from opendatasource('SQLOLEDB','server={server};uid={uid};pwd={pwd}').[DataBaseName].dbo.TableName

 

 

------------------------------------------------------------
--语句运行完以后执行这段关闭配置
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure
------------------------------------------------------------

相关文章:

  • 2021-09-27
  • 2022-12-23
  • 2021-07-04
  • 2021-11-15
  • 2021-12-22
  • 2022-12-23
猜你喜欢
  • 2022-02-22
  • 2022-12-23
  • 2022-02-13
  • 2021-09-30
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案