Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting in batch
Message
 
 
À
09/05/2011 12:27:47
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:
01510073
Message ID:
01510078
Vues:
70
This message has been marked as the solution to the initial question of the thread.
>I use the following syntax to insert in batch:
>
>
>INSERT INTO Search
> (NoThread,AddUser) 
>VALUES
> (1505069,1),
> (1505024,1),
> (1501270,1),
> (1501269,1),
> (1501268,1),
> (1498786,1)
>
>
>Lets assume I have 134 records to insert here. The time to insert those 134 records is 0.0156. If I have 2000 records to insert, this is still extremely fast.
>
>However, in another application I have, the list of fields to insert is about 20 and contains some long character fields such as FirstName at 25 characters, LastName at 25 characters and Company at 100 characters. The time to insert 1000 records is at 20 seconds.
>
>Why is that such a big difference? Is the insert in batch affected by the number of fields?

Yes, it may be affected by the number and size of the fields. Try splitting the batches to, say, 500 records and compare the speed.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform