Skip to content
 

Using sp_addlinkedserver

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.

EXEC sp_addlinkedserver
   @server=N'HOGEN-PC',				-- Remote Computer Name
   @srvproduct=N'',					-- Not Needed
   @provider=N'SQLNCLI',			-- SQL Server Driver
   @datasrc=N'HOGEN-PC\SQLEXPRESS';	-- Server Name And Instance

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.



Popular search terms:

2 Comments

  1. Dmitriy says:

    I foud that I whanted ! Thank’s.
    Dmitriy Deordiy.

  2. Gio says:

    Exactly what I need – simple and straight to the point! Thanks so much!

post a comment OR Post Your Question on our ASK! Community!