Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple row insert -> statement exceeds the maximum allowed number of 1000 row values

Tags:

I'm using sql 2008 express edition and I'm trying to do a multiple row insert thru my C# application.

I've got around 100000 records that needs to be inserted.

Okay all goes well for the first 1000 records then I'm getting the error:

"The number of row value expressions in the INSERT statement exceeds the maximum allowed number of 1000 row values."

I looked at my column data type -> int, so that shouldn't be the problem. I checked my code and I'm inserting in steps of 500 records.

So I googled it but couldn't find anything useful. Can somebody explain why I get this error and if possible how to solve it.

like image 790
Gerbrand Avatar asked May 04 '09 17:05

Gerbrand


1 Answers

You can use the SQLBulkCopy class. Which supports batching, transactions and is more efficient than standard insert statements.

like image 114
Jeremy Avatar answered Oct 05 '22 12:10

Jeremy