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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to switch servers in a sp

Status
Not open for further replies.

batteam

Programmer
Sep 12, 2003
374
US
My group has two servers, one for development, named PAERxxx and one for production, named NJRxxx. Does anyone know the sp syntax/code that will allow me to querying a table in a database while the query window I'm typing in is connected to the other one?

For example, when I'm connected to the NJROSxxx server, what code is needed in my open sp window to 'select' data from a table in the PAERSCxxx server, if this is possible?

Thanks for any help you can provide.
 
In my opinion, the easiest way to accomplish this is to set up a linked server from one server to the next. Configuring the linked server can be a bit of a pain (depending on permissions), but then it is relatively easy to query data from another server. Ex:

[tt][blue]
Select *
From [YourLinkedServerName].[YourDatabaseName].[YourSchemaName].[YourTableName]
[/blue][/tt]

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top