Alex Rivera | Logout

Cross-server SQL

Asked 2008-09-16T08:48:57.533
35

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.

Edit
Report

2 Answers

40

I think what you want to do is create a linked server as per this webarchive snapshot of msdn article from 2015 or this article from learn.microsoft.com. You would then select using a 4 part object name eg:

Select * From ServerName.DbName.SchemaName.TableName
answered 2008-09-16T08:59:04.843
1

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

answered 2008-09-16T08:52:50.020

Your Answer