Inserting Records Into SQL Server Using SqlBulkCopy

With the advent of .NET 2.0 Microsoft has incorporated SQL Server’s bcp command line utility into the framework. The System.Data.SqlClient.SqlBulkCopy class provides significant performance increases over regular inserts. It also works with the System.Data.SqlClient.SqlTransaction class.

Aside from offering DTS-like speed the SqlBulkCopy class is pretty flexible. SqlBulkCopy's WriteToServer method takes the following types as arguments:

  • DataRow[]
  • IDataReader
  • DataTable

Read more...

No Comments