Using sp_addlinkedserver
-
Posted on June 20, 2010 by Derek Dieter
-
0
The system stored procedure sp_addlinkedserver is used in order to link a server from the server in which you are executing the command. In order to connect to a remote SQL Server, you basically only need 3 parameters.
[cc lang=”sql”]
EXEC sp_addlinkedserver
@server=N’HOGEN-PC’, — Remote Computer Name
@srvproduct=N”, — Not Needed
@provider=N’SQLNCLI’, — SQL Server Driver
@datasrc=N’HOGEN-PCSQLEXPRESS’; — Server Name And Instance
[/cc]
If the remote SQL Server does not have an instance name, then the @datasrc parameter nee only contain the remote server name and not the instance.
Post a comment
- Comments (RSS)
- Trackback
- Permalink