Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference db on other server

Status
Not open for further replies.

BoydMT

Programmer
Joined
May 28, 2003
Messages
32
Location
US
I have 2 SQL Servers, SQL1 and SQL2.
I need to run stored procedures on SQL1 that reference tables in a database in SQL2.
Is this even possible? If so, how do I format the code?

Any help is greatly appreciated.
Thanks,
Mark
 
yes you can. You need to use fully qualified names. The complete name of an object, in this case a stored procedure, consists of four identifiers: the server name, database name, owner name, and object name.

Thanks

J. Kusch
 
You can set up linked server.You can set up linked server either by EM --- Security --- right click on Linked server to create new linked server.

Or by using sp_addlinkedserver (check books on line)
 
Thanks Jay. This looks promising.
Do you have, or know where I can find example code to do what you are suggesting?
This would definitely be helpful.

Thanks,
Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top