Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Transaction Isolation Level and Reading Data

$
0
0

Hi,

My Select statement is blocked when the table is modified in long running Transaction even after setting Isolation level to READ UNCOMMITTED.

Following i running in one query window

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[table1]') AND type in (N'U'))
DROP TABLE [dbo].[table1]
GO

create table Table1(col1 nvarchar(50),col2 nvarchar(50))


SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
go
Begin tran

insert into Table1 values('val1','val2')
insert into Table1 values('val11','val21')
insert into Table1 values('val11','val21')

waitfor delay '00:00:30'

commit tran

and running select statement at the same time in another query window, which is blocked until the above transaction is completed.

select * from table1

Even after setting READ UNCOMMITTED my select statement is blocked. any ideas?

I am using SQL SERVER 2008 R2

Thanks

Santosh



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>