0

I looked at all the isolation types.

But I could not find the mode I wanted.

It can be read by other transaction during the transaction. But, it will not add update and delete data.

For example (pseudo code):

create table abc
(id uniqueidentifier primary key)

Create proc procMain
trans isolation level **??????**
insert abc (id) values (newid())
Waiting 10 minute
commit

Create proc procREAD
select * from abc

Create proc procAdd
insert abc (id) values (newid())

create proc procUpdate
update abc id = newid()

create proc procDelete
delete from abc


now;
exec procMain (abc table access read only and for other access: LOCKED)

(waiting...)

exec procRead (OK) (Readable)
exec procAdd (NO - never) (locked)
exec procUpdate (NO - never) (locked)
exec procDelete (NO - never) (locked)

Thanks...

Is there such an isolation level? (transaction isolation level?)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Nazlı
  • 3
  • 4
  • There is no isolation level which forbids you to update or delete data. It's not what are isolation levels supposed to do. – TcKs Jun 12 '17 at 17:53
  • Actually I want to select serialize level. But the whole table is locked. Is there a row-based serialize isolation level? – Nazlı Jun 12 '17 at 18:16

2 Answers2

1

Sort of. If you set the READ COMMITTED SNAPSHOT database setting then READ COMMITTED sessions will not be blocked by in-flight transactions. But they will see the "last-known-good" version of the rows, ie the state before the current transaction started.

David

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67
0

You're looking for READ UNCOMMITTED. Learn more here. Pay mind that this will lead to dirty reads.

PicoDeGallo
  • 608
  • 9
  • 19