What is most effective and easy way to batch INSERT query into SQL 2005/8
-
06-07-2019 - |
Question
I'm new to ADO.NET
so asking for help. I have to insert large number of records in one table.
What is best-practice, effective and easy way to do that? I found an article called Batch Requests (ADO.NET Data Services Framework) but it isn't clear for me.
Also I found an article about BULK INSERT but such method uses external file, I don't want to use it because of having an ASP.NET
application.
Solution
Look at the SqlBulkCopy class. Also it sounds obvious, but not everyone knows this- you can significantly speed up insert performance by using transactions- I've blogged about this before.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow