Link to home
Start Free TrialLog in
Avatar of maike9
maike9

asked on

LinkedServer Connection to Same Database Server

I have two databases that have been backed up from production.  The stored procedures in one of the databases have references to a linked server connection to the other database.  In production, these two database reside on different servers.  I have backed up both databases and restored both of them to my default instance of Sql Server on my development machine.  My question is, is it possible to create a Linked Server connection back to the same instance of Sql Server so that the stored procedures work without any modifications to the linked server references?
Avatar of ValentinoV
ValentinoV
Flag of Belgium image

Sure, here's how you could create it (the linked server is called "test" here):

EXEC sp_addlinkedserver @server='test', @srvproduct='', @provider='SQLOLEDB', @datasrc='YourServer\YourInstance'

More info: http://msdn.microsoft.com/en-us/library/aa259589(v=sql.80).aspx
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial