Query across multiple databases/SQL Servers

  • Thread starter Thread starter RichardF
  • Start date Start date
R

RichardF

Is it possible to run a single query that pulls data from multiple
tables in multiple databases, perhaps also from multiple SQL Servers?

Any input would be appreciated.

Thanks!

RichardF
 
Yes. Specify the server and database:

select Select_Column_List
from Server_Name.DB_Name.Object_owner.Table_or_view_name

If from another server, you need to set up a linked server. See Linked
Server in Books Online.
 
Back
Top