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

multiple databases in single query

Status
Not open for further replies.

mlager

Programmer
Sep 1, 2006
74
US
I have a query that I wish to write that will need to utilize a table in a local database server and a table in a remote database server. How can I accomplish this?

I.E.

Table 1: users
IP 1: l27.0.0.1

Table 2: patients
IP 2: 10.0.10.11

I would need to do somthing like this (though I know this syntax is really wrong)

select a1.*
from 127.0.0.1.db1.users a1 inner join 10.0.10.11.db2.patients a2 on a1.id = a2.id

Is this possible?
 
It's MS Sql Server 2005, can't beleive I didn't mention that, sorry!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top