How to create a SQL Server link server with a different name.














If select SQL linked server in the GUI you can’t specify a different name for the SQL Server.  You can only use the SQL host name as the Link Server name.

 

Here is an example of creating a Linked Server via script to specify link server name myGX620 for the SQL Server host name GX620.

 

 

/****** Object:  LinkedServer [myGX620]    Script Date: 04/07/2009 22:49:10 ******/


EXEC master.dbo.sp_addlinkedserver


    @server = N’myGX620′,


    @srvproduct=N’MSSQL’,


    @provider=N’SQLNCLI’,


    @provstr=N’PROVIDER=SQLOLEDB;SERVER=GX620′


 


EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N’myGX620′,


    @useself=N’False’,@locallogin=NULL,@rmtuser=N’sa’,@rmtpassword=’P@ssword!’

Comments (0)