Concurrency Problem | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Concurrency Problem

Two users are trying to perform update transactions on the same row, one after the other at the same time. User1 had done the updation part. And I need to inform user2 that user1 made an updation with so and so data. Thank you With Regards
Aruna Mathew

If you use Front End application, assign data to variables and before updating select data from table and compare with the values of variables. If they are same, no updatation, else other user updated the row and show the new data Madhivanan Failing to plan is Planning to fail
Thank You Madhavan. Any other solution to this same query….cann’t i send through my Stored procedure itself…I used SET TRANSACTION ISOLATION LEVEL SERIALIZABLE. And before any updation on same row within perticular milliseconds time difference…I must send an out msg to front end through the same Update SP itself…Please relpy to this problem. With Regards Aruna Mathew
I am not sure whether this is feasible Declare @count int
Declare @t table(col1 datatype, col2 datatype,…..)
Insert into @t(columns) select columns from yourTable where <Condition>
select @count= @@RowCount –Now before updating the table query the same
If
(
select count(*) from
(
Select columns from @t
Union
select columns from yourTable where <Condition>
) T
[email protected]) –No change in the rows else –Changes in the rows
Madhivanan Failing to plan is Planning to fail
]]>