November 13, 2003 at 3:33 pm
I am using ADO.NET to insert some data into a database using Microsoft
SQL 2000.
I need to be able to insert approximately 900 values very quickly (< 5
secs) if possible. The catch is... Each of these inserts goes into a
different table. Right now, the inserts take between 15-30 seconds.
Currently, I am using the following mechanism (looped 900 times):
oCmd.CommandText = query
oCmd.ExecuteNonQuery()
Is there a faster, more efficient way to do this?
November 17, 2003 at 12:00 pm
This was removed by the editor as SPAM
November 18, 2003 at 6:50 am
Are you using a stored proc? That would speed it up some.
Andy
November 18, 2003 at 7:04 am
Is it possible to create an array of the data and pass that to SQL Server? You might not be able to fit all the data into one array but it could significantly reduce the number of round trips from client to server.
For info on processing arrays in SQL Server have a look at these:
http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm
http://www.algonet.se/~sommar/arrays-in-sql.html
Jeremy
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply