-- 开启 exec sp_configure ‘show advanced options‘,1 reconfigure exec sp_configure ‘Ad Hoc Distributed Queries‘,1 reconfigure SELECT top 5 * FROM OPENDATASOURCE(‘SQLOLEDB‘,‘Data Source=192.168.2.208;User ID=sa;[email protected]‘).[CCPG_PM].dbo.[COM_UserInfo] P where p.[GC_Flag]=0 SELECT top 5 * FROM OPENROWSET(‘SQLNCLI‘,‘192.168.2.208‘;‘sa‘;‘[email protected]‘,‘select * from [CCPG_PM].dbo.[COM_UserInfo] P where p.[GC_Flag]=0‘) AS a -- 关闭 exec sp_configure ‘Ad Hoc Distributed Queries‘,0 reconfigure exec sp_configure ‘show advanced options‘,0 reconfigure
时间: 2024-11-05 19:43:03