views:

19

answers:

2

Hello.
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 decision.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?

+2  A: 

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.

Martin Smith
+1  A: 

in Tab 2

SELECT * FROM decision.tRequests with (nolock)
SQLMenace