sql server跨数据库查询,并启动Ad Hoc Distributed Queries

exec sp_configure ‘show advanced options‘,1    --开起
reconfigure
exec sp_configure ‘Ad Hoc Distributed Queries‘,1
reconfigure
Go


SELECT distinct([GoodsCode]) FROM  OPENROWSET(‘SQLOLEDB‘,‘192.168.8.88‘;‘sa‘;‘123456‘,[Test].[dbo].[Customs]) 

exec sp_configure ‘Ad Hoc Distributed Queries‘,0   --关闭
reconfigure
exec sp_configure ‘show advanced options‘,0
reconfigure

  

sql server跨数据库查询,并启动Ad Hoc Distributed Queries

上一篇:疑似Windows server自动更新引发的sqlserver宕机


下一篇:系统MySQL服务无法启动报错1067的四种解决方法win7系统MySQL服务无法启动报错1067的四种解决方法