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

Click here to load this message in the networking platform