Friday, 17 December 2010

Help with Linked Servers using SQL Scripts

Cannot remember why I needed to do this, think something was being funny when trying to run the Enterprise Manager as a local account rather than a domain account;


EXEC master.dbo.sp_addlinkedserver
@server = 'your linked server name',
@srvproduct = '',
@provider = 'MSDASQL',
@provstr = 'DRIVER={SQL Server};SERVER=MyServer;UID=sa;PWD=sapwd;'


The above creates a default link to the Master Database on your desired server. Once Created go into the properties of the linked server and fill in the "Catalog" field to point to the database you want. 2

No comments:

Post a Comment