(text/x-fossil-plain)
I created a "BulkCopy" class based on a insert statement with parameters and multiple value sets.
INSERT into <table> (Column1, Column2) values (?,?),(?,?)
The interface has an array of types for the columns and a IEnumerable<object[]>.
The advantage over a normal insert statement. It removes a lot of overhead and checks. The inner loop only binds the parameters, execute, reset and clear the statement. That's super fast. With this solution I was able to insert (int, string of 1 char) over 3 million rows per second on my machine.
|