Querying across 2 different databases is a distributed query. Here is a list of some techniques plus the pros and cons:
- Linked servers: Provide access to a wider variety of data sources than SQL Server replication provides
- Linked servers: Connect with data sources that replication does not support or which require ad hoc access
- Linked servers: Perform better than OPENDATASOURCE or OPENROWSET
- OPENDATASOURCE and OPENROWSET functions:
Convenient for retrieving data from data sources on an ad hoc basis.
OPENROWSET has BULK facilities as well that may/may not require a format file which might be fiddley
- OPENQUERY: Doesn't support variables
- All are T-SQL solutions. Relatively easy to implement and set up
- All are dependent on connection between source and destionation which might affect performance and scalability