I would like to add a linked server to a remote sql server.
The purpose would be to copy table from that server to my local sql server.
My remote server name: remoteserver
username: sa
password: sa
Can any body can share the sql for creating linked server?
Linked Server Creation
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Mike7 reputationPosted Nov 11, 2010, 3:03 AM EST
sp_addlinkedsrvlogin @rmtsrvname = 'linkerservername',@locallogin = '',@rmtuser = 'sa',@rmtpassword = 'sa'
or you can right click properties the new linked server and set the username properties there.
Mike7 reputationPosted Nov 11, 2010, 2:00 AM EST
Try this :
exec sp_addlinkedserver @server = 'servername', @srvproduct = '', @provider = 'sqloledb',
@datasrc = 'serverhostname', @catalog = 'dbname'
Substituting the above for your names.
Thanks
Jean PaulRank #32 · 38.5K reputationPosted Nov 11, 2010, 2:55 AM EST
Jean PaulRank #32 · 38.5K reputationPosted Nov 11, 2010, 3:36 AM EST