I am trying to figure out the best way to design my C# application which utilizes data from a SQL Server backend.
My application periodically has to update 55K rows each one at a time from a loop in my application. Before it does an update it needs to check if the record to be updated exists.
If it exists it updates one field. If not it performs an insert of 4 fields.
The table to be updated has 600K rows.
- What is the most efficient way to handle these updates/inserts from my application?
- Should I create a data dictionary in c# and load the 600K records and query the dictionary first instead of the database?
- Is this a faster approach?
- Should I use a stored procedure?
- What’s the best way to achieve maximum performance based on this scenario?