When I want to insert huge amount of data into database, which way is more efficient? 1. insert data row by row by calling insert statement 2. create a user defined Table type in my database, and write a stored procedure to insert a DataTable into database. and why?
The most efficient would be SQL Bulk Insert.
To improve the performance further you can use SqlBulkCopy to SQL Server in Parallel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With