Bulk Copy with SQL Server

Published 19 November 07 12:26 | Urs Meier - Blog on IT
SQL Server also offers an "array insert" possibility via .NET, which is called bulk copy.

I wrote a similiar application as with the Oracle ODP.NET array insert. The point was not to compare Oracle vs. SQL Server, but to verify if the bulk copy is really faster than a normal insert via the SqlAdapter.
Again, bulk copy is - depedening on the rowsize - 10 to 20 times faster. Generally speaking, the difference between SQL Server bulk copy and SQL Server SqlAdapter is somewhat bigger, than than the difference between Oracle array insert and OracleAdapter. Which only means, that it is worthwhile to use these features in both products.

The nice thing about ADO.NET bulk copy is its simplicity.

SqlBulkCopy bulkCopy = new SqlBulkCopy(ConnectionString);
bulkCopy.DestinationTableName = "bulktesttable";
bulkCopy.WriteToServer(this.bulkTestDataSet.bulktesttable);





Again, feel free to ask for the code I used in order to make your own tests and conclusions.

Lesen Sie den vollständigen Eintrag unter http://ursmeier.blogspot.com/2007/11/bulk-copy-with-sql-server.html

Abgelegt unter: , ,