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 haveSET 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)
精彩评论