跨Server查询
EXEC sp_configure 'show advanced options', 1 GO RECONFIGURE GO EXEC sp_configure 'Ad Hoc Distributed Queries', 1 GO RECONFIGURE GO SELECT MAX(OldestCall) FROM ( SELECT FeildAA As FeildAAFROM OPENDATASOURCE('SQLOLEDB','Data Source=1270.0.1;User ID=sa;Password=sa').DBNameA.dbo.TableNameA AS A INNER JOIN OPENDATASOURCE('SQLOLEDB','Data Source=127.0.0.1;User ID=sa;Password=sa').[DBNameB].[dbo].[CMS_TableNameB] AS B ON A.ID= B.ID ) AS AA