谢谢郑文童子
-- Define a linked server on an instance of SQL Server by using @datasrc.
sp_addlinkedserver
@server = 'LondonPayroll1',
@srvproduct = ' ',
@provider = 'SQLNCLI',
@datasrc = 'London\Payroll'
-- Define a linked server on an instance of SQL Server by using
-- server_name\instance_name in a provider string.
sp_addlinkedserver
@server = 'LondonPayroll2',
@srvproduct = ' ',
@provider = 'SQLNCLI',
@provstr = 'Server=London\Payroll'
-- Specify an instance of SQL Server in OPENDATASOURCE
-- by using a provider string.
SELECT *
FROM OPENDATASOURCE('SQLNCLI',
'Data Source=London\Payroll;Integrated Security=SSPI')
.AdventureWorks2008R2.HumanResources.Employee
-- Specify an instance of SQL Server in OPENROWSET
-- by using a provider string.
SELECT a.*
FROM OPENROWSET(
'SQLNCLI',
'Server=London\Payroll;Trusted_Connection=yes',
AdventureWorks2008R2.HumanResources.Employee) AS a |