先看一段代码If OBJECT_ID('tempdb..##temp1') is not null
drop table ##temp1
create table ##temp1 (id int)If OBJECT_ID('tempdb..##temp2') is not null
drop table ##temp2
create table ##temp2 (id int)
insert ##temp1 
Select 1 union select 2 union select 3insert ##temp2
Select 1 union select 2 union select 3
SET TRANSACTION ISOLATION LEVEL Read uncommitted;
--窗口1执行
begin tran
update ##temp2 set id = 3 where id = 3 waitfor delay '0:0:05' select * from ##temp1 where id = 3
commit tran--窗口2执行
begin tran
update ##temp1 set id = 3 where id = 3 waitfor delay '0:0:05' select * from  ##temp2 where id = 3
commit tran结果
/*
(1 row(s) affected)
Msg 1205, Level 13, State 45, Line 6
Transaction (Process ID 54) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
*/关于read uncommitted,MSDN上说Transactions running at the READ UNCOMMITTED level do not issue shared locks to prevent other transactions from modifying data read by the current transaction. READ UNCOMMITTED transactions are also not blocked by exclusive locks that would prevent the current transaction from reading rows that have been modified but not committed by other transactions.
也就是说第一个tran里我update但是未提交的数据应该不会阻碍第二个tran里select的语句,同理第二个tran里update也不会阻碍第一个tran的select.可是结果还是deadlock了...是我理解有误吗?求解...谢谢