Home All Groups Group Topic Archive Search About

Issue select across multiple SQL Server Databases

Author
31 Oct 2006 4:15 PM
twahl
This may be a dumb question but...
I have an instance of SQL Server 2005 that contains two databases call them
DB_A and DB_B.  Is it possibel to issue a query where I am joining a table
from DB_A to a table in DB_B?
Thanks,
Terry

Author
31 Oct 2006 5:13 PM
Massimo
"twahl" <tw***@discussions.microsoft.com> ha scritto nel messaggio
news:0FFF1B0E-A115-4C06-B2F7-2A7F1EBC0959@microsoft.com...

> This may be a dumb question but...
> I have an instance of SQL Server 2005 that contains two databases call
> them
> DB_A and DB_B.  Is it possibel to issue a query where I am joining a table
> from DB_A to a table in DB_B?

Yes.
The syntax is "dbname.user.table", so you should use something like
"DB_A.dbo.tablename" and "DB_B.dbo.tablename". The user you're currently
logged on needs to have permissions on both databases, of course.


Massimo

AddThis Social Bookmark Button