allow_snapshot_isolation option [database]

Controls whether snapshot isolation is enabled or disabled.

Allowed values

On, Off

Default

Off

Scope

Can be set for the PUBLIC group only. DBA authority required.

Remarks

This option controls whether snapshot isolation is enabled for the database. Once this option is set to On, the database server starts recording the original versions of updated rows in the temporary file in the event that a transaction uses snapshot isolation.

If there are transactions in progress when the setting of the allow_snapshot_isolation option is changed, then the change does not take effect immediately. Any transactions that are running when the option setting is changed from Off to On must complete before snapshots can be used. When the setting of the option is changed from On to Off, any outstanding snapshots are allowed to complete before the database server stops collecting version information, and new snapshots are not initiated.

You can view the current snapshot isolation setting for a database by querying the value of the SnapshotIsolationState database property:

SELECT DB_PROPERTY ( 'SnapshotIsolationState' );

The SnapshotIsolationState property has one of the following values:

  • On   Snapshot isolation is enabled for the database.

  • Off   Snapshot isolation is disabled for the database.

  • in_transition_to_on   Snapshot isolation will be enabled once the current transactions complete.

  • in_transition_to_off   Snapshot isolation will be disabled once the current transactions complete.

See also
Example

The following statement enables snapshot isolation for a database:

SET OPTION PUBLIC.allow_snapshot_isolation = 'On';