Cross-server SQL Cross-server SQL sql-server sql-server

Cross-server SQL


I think what you want to do is create a linked server as per this msdn article. You would then select using a 4 part object name eg:

Select * From ServerName.DbName.SchemaName.TableName


You can use Open Data Source Like this :

EXEC sp_configure 'show advanced options', 1GORECONFIGUREGOEXEC sp_configure 'Ad Hoc Distributed Queries', 1GORECONFIGUREGOSELECT  *FROM    OPENDATASOURCE('SQLOLEDB',                   'Data Source=<Ip Of Your Server>;                    User ID=<SQL User Name>;Password=<SQL password>').<DataBase name>.<SchemaName>.<Table Or View Name>Go


Are SQL Server Integration Services (SSIS) an option? If so, I'd use that.