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 SkipVought 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 different dbs 1

Status
Not open for further replies.

shyamal

Programmer
Aug 14, 2000
79
0
0
US
Just curious, is this possible regardless of Sybase or NT server.

If I have table A in DB1 and table A in DB2 can these be joined as long as there are common fields i.e. Sales_Id exists in both tables, If so how can this be done? I was just curious, this is a longshot. I was transferring data from one db to another db and just thought that there had to be other alternatives to my method.
 
Yes, and the syntax for that is:

SELECT db1.col_1, db2.col_2
FROM DB1.dbo.A db1 INNER JOIN DB2.dbo.A db2 ON db1.col_id = db2.col_id

I hope this answers your question.
Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top