简体   繁体   中英

SQL Server data transfer

In SQL Server, I have a data source server which has 22 databases and in each database there are 5 tables. Every db has the same table includes different data separated through years.

I want to collect all this data into one single database. Destination database will have only 5 tables, while source has 22 x 5 = 110 tables. I'm using import-export wizard to transfer data but it takes too long and really annoying stuff. For 110 tables I'm going to have to start import-export wizard.

Is there a simple way, tool to do this? There is no linked server between servers.

Here is a simple figure that explains my situation.

说明

Posting my comment as an answer:

Back up each database, restore it to server 2 and then insert the records across using a simple INSERT .. SELECT statement, then drop the restored database and restore the next? You should be able to script this to work unattended, even the creation of all the backups could be scripted to only need a single 'run' which will run for all databases

Your other option (if space permits) is to create a new database on server 1 (potentially a restore of the database on server 2 if it has data already in it), then import all records across into this new database, then backup this database and restore it on server 2.

It depends on several thing like how often do you want the data to be moved, will it be changed on the destinations DB's?

There are 4 methods of High Availability on SQL Server. One of them will surely fits to your scenario (probably a merge replication)

http://msdn.microsoft.com/en-us/library/ms190202.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM