--启动 EXEC SP_CONFIGURE 'show advanced options',1RECONFIGURE EXEC SP_CONFIGURE 'Ad Hoc Distributed Queries',1RECONFIGURE --查询 SELECT [ID] FROM OPENDATASOURCE('SQLOLEDB','DataSource=.;User ID=sa;Password=sa').DBName.dbo.TableName
--关闭 EXEC SP_CONFIGURE 'Ad Hoc Distributed Queries',0RECONFIGURE EXEC SP_CONFIGURE 'show advanced options',0RECONFIGURE