Yes you can join tables from the two databases.
Assuming that the databases are on the same server simply use the three part name of the table in the other database.
<pre>SELECT *
FROM LocalTable a
JOIN RemoteDatabase.dbo.RemoteTable b on a.PartNo = b.PartNo</pre>
If the table is on a remote instance then you need to create a linked server to the remote instance and use the four part name of the remote table.
<pre>
SELECT *
FROM LocalTable a
JOIN RemoteServer.RemoteDatabase.dbo.RemoteTable b on a.PartNo = b.PartNo</pre>
Discuss This Question: 1  Reply