Query And Join Tables Across Server Instances.
Join the DZone community and get the full member experience.Join For Free
Use the following to query or join tables on remote servers. The query must be executed on a system running SQL Server, but the remote system can be pretty much anything an ODBC driver exists for:
select * from OpenDataSource(â€™SQLOLEDBâ€˜,â€™Data Source=server.asdf.com;User ID=yourusername;Password=yourpasswordâ€˜).somedatabase.dbo.sometable;