Boris Callens Boris Callens - 4 months ago 52
SQL Question

Cross-server SQL

I want to port data from one server's database to another server's database.
The databases are both on a different mssql 2005 server.
Replication is probably not an option since the destination database is generated from scratch on a [time interval] basis.

Preferebly I would do something like

insert *
from db1/table1
into db2/table2
where rule1 = true

It's obvious that connection credentials would go in somehwere in this script.


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