My stored procedure is like this.

Im maintaining a RowVersion in Table A.

  1. Starts Transaction
  2. Read RowVersion from Table A rw1
  3. ...
  4. Some Calculations
  5. ...
  6. Read RowVersion from Table A as rw2
  7. Update Some Tables including Table A
  8. IF(rw1==rw2)
  9. COMMIT
  10. ELSE
  11. ROLLBACK

Currently im using READ COMMIT as Isolation Level But When its updating Table A RowVersion is also changing.

Goal : when two or more users logged in to system and press a button at same time (which will execute this SP) first one only execute the SP and not allow other one to execute

0 Answers