Home > database >  Questions about the row locks
Questions about the row locks

Time:09-17

A table TEST


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 tran
Select * from test (updlock) where id=1
Waitfor delay '00:00:10'
Update the test set flag=1 where id=1 and flag=0
commit
  • Related