snippetsqlMinor
How to move a fairly large tsql table from one server to another server?
Viewed 0 times
tsqlfairlymoveonelargeanotherhowserverfromtable
Problem
I have been working on thinking of ways to move a 40gb table from one SQL Server box to another SQL Server box. They are at separate companies without an intranet linkage and obviously without linked servers.
Initially, I thought the quickest way to do this was to pull the nightly backup file and get this over to the other server. Create a database from the backup and then transfer my table from that database to the existing.
After thinking about this though, I can't have all the data in that particular database at the other company due to security reasons. Whereas the table I am after is computational and unrelated to any type of company specific competitive edge.
Either way, what I am looking for is how I can export a table of that size quickly and efficiently and get it into a database that is in no way connected to the existing database.
This is my first time researching something along this line, and I am pretty sure I don't want to script the table. Initially, I thought the bak file was my best bet, but can't do the entirety of the db.
Initially, I thought the quickest way to do this was to pull the nightly backup file and get this over to the other server. Create a database from the backup and then transfer my table from that database to the existing.
After thinking about this though, I can't have all the data in that particular database at the other company due to security reasons. Whereas the table I am after is computational and unrelated to any type of company specific competitive edge.
Either way, what I am looking for is how I can export a table of that size quickly and efficiently and get it into a database that is in no way connected to the existing database.
This is my first time researching something along this line, and I am pretty sure I don't want to script the table. Initially, I thought the bak file was my best bet, but can't do the entirety of the db.
Solution
A couple of feasible options, in order of my preference:
Option 1
Option 2
Option 1
- Create a new, empty database locally - maybe make the log file large enough, at least temporarily, to accommodate the entire set of data you are moving without growth
- Use
SELECT INTO, the Import/Export "Wizard", or Red Gate SQL Data Compare to copy this table to the new database (note that if you useSELECT INTOyou'll have to create any indexes, constraints etc. manually)
- Back up the new database, and send that .bak over (note that the log may be bigger than you expect due to the initial data movement)
Option 2
- Back up your database locally
- Restore as a copy
- Drop everything but this one table
- Back up the copy, and send that .bak over
Context
StackExchange Database Administrators Q#97852, answer score: 9
Revisions (0)
No revisions yet.