分布式查询
EXEC sp_addlinkedserver
'server2',
'',
'MSDASQL',
NULL,
NULL,
'DRIVER={SQL Server};SERVER=***;UID=**;PWD=****;'
GO
EXEC sp_addlinkedsrvlogin 'server2', 'false', 'localUser','rmtUser','rmtPass'
EXEC sp_droplinkedsrvlogin 'server2', 'sa'
EXEC sp_dropserver 'server2', null
SELECT top 2 * FROM server2.pubs.dbo.authors