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?
When I want to insert huge amount of data into database, which way is
Share
The most efficient would be SQL Bulk Insert.
To improve the performance further you can use SqlBulkCopy to SQL Server in Parallel.