Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting in batch
Message
From
09/05/2011 12:27:47
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Inserting in batch
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01510073
Message ID:
01510073
Views:
118
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
Next
Reply
Map
View

Click here to load this message in the networking platform