开发者

Read uncommitted isolation level doesn't allow to read entries

I need to read dirty entries in Sql server but I don't understand why I can't. Hope you will help. I have two tabs in management studio with following code

Tab 1:

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
GO
BEGIN TRAN
    UPDATE decision.tRequests
    SET IsComplete = 0

    WAITFOR DELAY '00:00:25.000'        
COMMIT TRAN  

Tab 2:

SELECT * FROM d开发者_如何转开发ecision.tRequests

When I run tab1 and then tab2 I can see that the query from tab2 takes more than 25 seconds to complete. When run script form tab2 without tab1 it take 0 seconds to complete.

Why even if I have SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED are the entries locked?


You need to set SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED in Tab2 not Tab1.

Tab2 will still be running under the default READ COMMITTED level.


in Tab 2

SELECT * FROM decision.tRequests with (nolock)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜