Posts

Showing posts from March, 2014

A Comparison of Various SQL Server Bulk Insert Options in Microsoft .NET

Last month, I worked on a requirement of inserting bulk data into SQL Server database. I evaluated different solutions available in .NET for this purpose, and finally came up with the following comparison chart, which will be useful when someone takes up this common task in their project - Passing Table Value Types SQL Server’s Xml OPENROWSET SQL Data Adapter SQL Bulk Copy Make Database Calls in a Loop Feature Set Can perform CRUD operations on any related database objects in a single client transaction. Same as Table Value Types. Same as Table Value Types. Supports only Insert operations on one table. Same as Table Value Types. Ease of Implementation Tedious and laborious, but quite repetitive. So much easier when compared to Table Value Types. Simpler than the first 2. Simpler than the first 2. Simplest of all of them. Type Safety Yes No Yes (wi