Can I set Read Committed Snapshot Isolation for a specific query?
In order to run query like Read uncommitted, we can use “with (nolock)”. Is there something similar to RCSI?
I use SQL Server 2008R2
Thanks.
Can I set Read Committed Snapshot Isolation for a specific query? In order to
Share
The short answer is: no. The read committed snapshot database setting changes the semantics of the read committed isolation level so that it employs optimistic locking (instead of the default pessimistic). You can, however, try
set transaction isolation level snapshotbefore your query and see if that will accomplish what you’re looking for. NB: in order to use snapshot isolation, the database needs to be configured to allow it. Check the snapshot_isolation_state_desc column in sys.databases. If it’s off,alter database [yourdb] set ALLOW_SNAPSHOT_ISOLATION onwill do the trick.