Join multiple databases in one View -- SQL Server Mangement Studio

168 Views Asked by At

I would like to join fields from two different databases that reside on the same server, but I am having trouble with the syntax.

Can anyone provide some insight?

1

There are 1 best solutions below

0
On BEST ANSWER

Assuming that your user has privileges in both databases, just reference the "remote" object using three part naming:

SELECT columns
FROM database2.dbo.table