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

150 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 answers

0
Stuart Ainsworth 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