Issue select across multiple SQL Server Databases

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top