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

Multi Database Query 1

Status
Not open for further replies.

Deltaflyer

Programmer
Oct 11, 2000
184
GB
Can anybody help me, i need to do a one off look up into another database.

I am using SQL Server 7, and have two databases, Tactical and People. I need to JOIN a table in tactical to a table in people, is this even possible can anybody show me how to do it.

Thanks for any help, DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
Hi
-----
select tb1.*, a, b, c, d from Tactical.YourUserID.OneTable tb1 inner join People.YourUserID.OtherTable tb2 on
tb1.onecolumn = tb2.othercolumn
-----
Instead of UserID you may put nithing in many cases.
In theese cases you can write:
-----
.....from Tactical..OneTable tb1 inner join People..OtherTable tb2 on.....
-----
If you are the SequrityAdministrator in most cases you user ID is dbo what means db Owner. John Fill
 
Cheers John, that is brilliant. Saved me hours of work. DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top