begin tran -- 使查询的更新锁保留到事务结束
select * from Project with(holdlock, updlock) where ProjectID = 79
waitfor delay'00:00:30'
select * from Project where ProjectID = 87
commit tran
select * from Project with(holdlock, updlock) where ProjectID = 79
waitfor delay'00:00:30'
select * from Project where ProjectID = 87
commit tran