Thursday, September 3, 2015

SQL 2014 Linked Server - Create a linked server that points to a different sql server - alias

EXEC sp_addlinkedserver

@server=N'ALIAS',

@srvproduct=N'',

@provider=N'SQLNCLI',

@datasrc=N'MYSQLSERVER';

  EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=ALIAS',@useself=N'False',@locallogin=NULL,@rmtuser=N'sa',@rmtpassword='password'



Replace
  • ALIAS with the name you want for the Linked server connection
  • MYSQLSERVER with the name of the SQL server\instance you're linking to
  • sa with the user name on the linked server
  • password with the password on the linked server

No comments:

Post a Comment