I am trying to insert about 100,000 in my SQL Server database.
It is really slow when I create 100,000 separate queries, so I tried to insert all these records in one query, it worked for the first few thousands records but then it threw me a timeout error.
What would be the fastest way to insert multiple records into database?
also…don’t do this in a web request. you can get around this if you increase the CommandTimeout (different than the ConnectionTimeout), but best practice is to put these massive bulk loads into an out of process job that actually does the loading.