Would like to know what would be the best way to check if the records exist before INSERT/UPDATE or DELETE the record.
I assume MERGE would be an optimal way but i have read that i might not be the best solution as they have bugs and also affect performance (Now these articles that i have read could be older issues)
We are using SQL SERVER 2016. So any content relevant to this edition could be helpful?
I also think, checking the database based on the PK and based on the value returned that i can either perform an insert or update
for example If ( count from the table is 0) then Insert else update.
I am just trying to find the best way to handle our daily transactions. Our application processes an average of 200,000 records/hour.
Thanks