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!

Joining tables from 2 different databases

Status
Not open for further replies.

rizvir

Programmer
Aug 7, 2000
12
TH
Hello,

I need to join two tables (tb1 and tb2) which are in two different databases on the same server (db1 and db2). What is the best way to do it. Thanks for any help provided.

Rizwan.
 
Here's a way you can do it:

SELECT A.* B.*
FROM TableName As A
INNER JOIN DataBase.dbo.TableName As B
On A.Id = B.Id
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top