query tables on other DB | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

query tables on other DB

I am trying to join a few tables in one DB and one table in another DB. I can’t find the format in BOL. Please help. Thanks
Refer to linked servers in BOL.
http://www.sql-server-performance.com/hints_join.asp fyi. Satya SKJ
Contributing Editor & Forums Moderator
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
Try the following syntax; I used a LEFT OUTER JOIN as an example, but the principal is basically the same: SELECT * FROM DB1.dbo.table_name_from_DB1 TDB1
LEFT OUTER JOIN DB2.dbo.table_name_from_DB2 TDB2
ON TDB1.id = TDB2.id – Tahsin