|
|
|
Here is the T-SQL script to add linked server using sp_addlinkedserver SP. Once you add linked server you can add login using sp_addlinkedsrvlogin. By default current login is mapped with linked server means remote machine must have exact same login with same password in order to get access to the linked server but this is not the case most of time so you need step [3]. |
Click here to copy the following block | USE MASTER GO
Exec sp_addlinkedserver @server='webdb', @srvproduct='', @provider='SQLOLEDB', @datasrc='AMD64', @catalog='Northwind'
GO
Exec sp_serveroption 'webdb', 'data access', 'true' Exec sp_serveroption 'webdb', 'rpc', 'true' Exec sp_serveroption 'webdb', 'rpc out', 'true' Exec sp_serveroption 'webdb', 'collation compatible', 'true'
GO
Exec sp_addlinkedsrvlogin @useself='false', @rmtsrvname='webdb', @rmtuser='remote_login' , @rmtpassword='pass_of_remote_login' |
Now you can try to run the following query to test your SQL linked server |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|