Sample Header Ad - 728x90

Copying a table (and all of its data) from one server to another?

9 votes
5 answers
9074 views
I have a massive table, let's say 500,000 rows. I want to copy it (schema and data) from one server to another. This is not an upsert or any kind of update; It's a one-off straight copy and paste. What are the idiomatic approaches to this? I've tried: - Restoring a backup from one server on to another. This is impractical, because SQL Server notoriously cannot restore tables from a backup; It can only restore databases. And my database is huge! - Using SSMS to script the table's data as a sequence of INSERT statements. This is impractical, because the inserts have to be done row by agonising row. I suspect that this also does awful things to the transaction log, but nobody has attacked me for this yet (I'm running such a script right now, it's going to take hours).
Asked by J. Mini (1237 rep)
Nov 23, 2023, 07:00 PM
Last activity: Apr 9, 2024, 07:49 PM