Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimizing massive update
Message
 
À
31/03/2015 20:34:39
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01617566
Message ID:
01617643
Vues:
52
J'aime (1)
>I have a program which runs for hours to update thousands of records. The program runs in a loop updating records one by one. As is the case for an insert command, is there any special syntax which would allow us to update multiple records in one command, saving precious time in the process?

I am not sure if I can help you for you are not giving much details, but I can tell you my experience with some big updates I had. The background is a process that creates very compact binary files that I needed to parse and store in SQL, each file has 2 million records and we get a new one every half an hour, the first version of the program parsed the binary file record by record and inserted the records into the SQL database, but it would take the process more than half an hour, making it of course nonviable as it would fall behind, I found out that the parsing was very very fast, but the bottle neck was the inserts, so I changed the program to use SQL Bulk Copy (System.Data.SqlClient.SqlBulkCopy) and the whole process takes about a minute. HTH
"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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform