I want to improve the performance of a console application which takes in a text file with millions of lines and currently inserts each line one at a time into a SQL table.
Using Parallel.For, I'd like to improve this, since each operation is independent of the next. Since each iteration executes a SQLCommand, I would like to know if this is a safe approach. I'm not sure how this works internally and don't want to cause performance issues on the database. For instance, could the database freeze or crash if the Parallel.For creates too many tasks for the sql server to handle?