Select * from test where id=1
Waitfor delay '00:00:10'
Update the test set flag=1 where id=1 and flag=0
When the UPDATE performed to let other people take to the
Select * from test where id=1
CodePudding user response:
the begin tranSelect * from test (updlock) where id=1
Waitfor delay '00:00:10'
Update the test set flag=1 where id=1 and flag=0
commit