var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Querying tables from different databases on same sql server
How do I query two tables in different databases on the same SQL Server?
In short, I want to do:
from database 1. table 1 as A
inner join database 2. table 1 as B
on A.COL1 = B.COL1
Both database 1 and 2 are on the same SQL Server.
You just need to fully qualify the object names:
select * from Database.Owner.Table
...but the owner is assumed to be dbo if omitted, so this works most of the time:
select * from Database..Table
Huh...I didn't know this. I guess you learn something new everyday.
Pretty much any day that is worth getting out of bed anyway!
Originally Posted by Reghardt
you also forget something every day. trick is to forget the useless stuff.