views:

51

answers:

2

I need to get data from 3 different databases on one event command. Can anybody tell me any efficient way besides I am querying to all three different database servers in a row:- Server 1 : Select * from .... Server 2 : Select * from..... and so on...

Thanks very much

+3  A: 

Seeing as the question is marked TSQL:

  1. Install the providers for the 'other' databases.
  2. In SQL Server 2005, create a linked server to each database, and then simply query as though the 'other' databases were SQL Server databases.
Mitch Wheat
It makes sense. Thanks
Novice
+1  A: 

If the databases are on the same server instance, they can be queried in the format "database_name.table_name.column_name" otherwise I would use Mitch's answer (linked servers can be queried in the format "server_name.database_name.table_name.column_name")

Brian Barnes