BulkInsert to SQL, parallel processing
I'm trying to improve the processing speed of a 3rd party integration (via SDK), wherein the processed data is written to SQL.
I was able to reduce the total time of processing the 3rd party system from 40 hours to 3 by improving the methods used to process the data, and to turn the sequencing processing into parallel processing. The challenge I face now is with writing the data to SQL.
What I currently have is the following:
With this method, I'll use a temp table with a merge / insert strategy to add or update the records. The problem is that the original
I was able to reduce the total time of processing the 3rd party system from 40 hours to 3 by improving the methods used to process the data, and to turn the sequencing processing into parallel processing. The challenge I face now is with writing the data to SQL.
What I currently have is the following:
With this method, I'll use a temp table with a merge / insert strategy to add or update the records. The problem is that the original
Parallel.ForEach is sometimes running twice for the same record, when there truly is only 1 record available. There's 8 million records I need to process in this manner, and without using the Parallel method on the input records, it takes far too long to process all the data. Any thoughts / help?