模擬DeadLock

begin tran

update workorder

set wonum='1048841'

where siteid='ASTROS'

and wonum='100062'

WAITFOR DELAY '00:00:05'

select * from workorder

where siteid='ASTROS'

and wonum='100061'

commit

begin tran

update workorder

set wonum='1048840'

where siteid='ASTROS'

and wonum='100061'

--WAITFOR DELAY '00:00:03'

commit

update workorder

set wonum='100062'

where siteid='ASTROS'

and wonum='1048841'

update workorder

set wonum='100061'

where siteid='ASTROS'

and wonum='1048840'

原文地址:https://www.cnblogs.com/Snowfun/p/1836426.html