Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting in batch
Message
De
09/05/2011 12:27:47
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Inserting in batch
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01510073
Message ID:
01510073
Vues:
119
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?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform