SQL Server/T-SQL Tutorial/System Functions/sp addlinkedserver — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 13:46, 26 мая 2010
Add a server link
sp_addlinkedserver [@server =] "<server>"
[, [@srvproduct =] "<product name>"]
[, [@provider =] "<provider name>"]
[, [@datasrc =] "<data source path>"]
[, [@location =] "<location>"]
[, [@provstr =] "<connection string>"]
[, [@catalog =] "<database or equivalent for datasource>"]
EXEC sp_addlinkedserver @Server = "MyLocalServer",
@srvproduct = "SQLServer OLEDB Provider",
@provider = "SQLOLEDB",
@datasrc = "SOCRATES"
SELECT CustomerID, CompanyName
FROM MyLocalServer.Northwind.dbo.Customers
WHERE CustomerID < "1"