0

I have an employee table in which new records are inserting by procedure dbo.ISP_InsertEmplyoeeDetails. But at the same time another procedure dbo.USP_UpdateEmplyoeeDetails is updating the same records which are inserting in procedure dbo.ISP_InsertEmployee but not committed yet.

This creates data anomalies. I need to implement two scenarios here based on some the condition:

  • Scenario 1: need to update the uncommitted insert data based on some condition
  • Scenario 2: update will be blocked or on hold till insert operation committed its records
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    You cannot update an uncommitted record set in database. Why not check for a last update column before updating the record set, and if the last update column is not what you expect than it means someone has updated the records. Insert should be easy since you can rely on primary keys. – peeyush singh Apr 22 '19 at 03:52
  • Thanks Peeyush ..Can you please help me out with query – Sukdev Mandal Apr 23 '19 at 09:19
  • There's not enough information here for me to help you out, but try searching for multiple client updating database, and you will find the typical approach for these scenario's. Have a look at this: https://stackoverflow.com/questions/24616998/multiple-db-users-updating-at-the-same-time – peeyush singh Apr 23 '19 at 11:24

0 Answers0