DAAB - Bulk Update/Insert Using EL6

Topics: Data Access Application Block
Nov 18, 2014 at 3:55 PM
What's the best option to attain bulk Update/Insert using EL 6. We need to avoid multiple DB calls.
Nov 18, 2014 at 4:32 PM
You can use the UpdateDataSet methods to send batch operations. See Updating the Database from a DataSet from the
Developer's Guide to Microsoft Enterprise Library. You can set the batch size with the UpdateBatchSize parameter (use 0 for the max the database supports). See also Performing Batch Operations Using DataAdapters.

Another option is to use table valued parameters to pass multiple "records" to either a stored procedure or SQL Text command. See Use Table-Valued Parameters.

Actual performance will depend on the amount of data, network conditions, etc. Another non Enterprise Library solution is to use the SqlBulkCOpy.

Randy Levy
Enterprise Library support engineer
Support How-to