Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Snapshot isolation must be enabled by setting the ALLOW_SNAPSHOT_ISOLATION ON database option before it is used in transactions. You must enable snapshot isolation in each database that uses it with the Transact-SQL ALTER DATABASE statement. In this respect, snapshot isolation differs from the traditional isolation levels of READ COMMITTED, REPEATABLE READ, SERIALIZABLE, and READ UNCOMMITTED, which require no configuration.


The following statements activate snapshot isolation and replace the default READ COMMITTED behavior with SNAPSHOT:

Section
Column
width5%

 

Column
width95%
Panel No Format
bgColorCCC
ALTER DATABASE MyDatabase


SET ALLOW_SNAPSHOT_ISOLATION ON


ALTER DATABASE MyDatabase


SET READ_COMMITTED_SNAPSHOT ON

 

To check what the current snapshot isolation level, run the following SQL:

If the query returns 0 then it is turned off.

Section
Column
width5%

 

Column
width95%
panel No Format
bgColorCCC
select name, snapshot_isolation_state_desc, is_read_committed_snapshot_on from sys.databases