Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting millions of records
Message
 
À
05/09/2013 18:05:02
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01582347
Message ID:
01582359
Vues:
49
This message has been marked as a message which has helped to the initial question of the thread.
>I need to remove about two millions records from a table. This is because on a development environment, I need to start from a fresh copy of the production. However, when deleting so many rows, it takes a very long time because of the log process. How to delete all the records without having this log process to slow things down?

I would just use Truncate, just remember to Truncate all related tables (that might hold a FK)

If you want to actually delete them, then you need to delete by chunks, there is a post about it here and here and here
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform