BEGIN SNAPSHOT statement

Use this statement to start a snapshot at a specified period in time for use with snapshot isolation transactions.

Syntax
BEGIN SNAPSHOT
Remarks

By default, when a transaction begins, the database server defers creating the snapshot until the application causes the first row of a table to be fetched. You can use the BEGIN SNAPSHOT statement to start the snapshot earlier within the transaction. The database server creates a snapshot when the BEGIN SNAPSHOT statement is executed by a snapshot transaction.

The statement fails and returns an error when either of the following conditions is met:

This statement is also useful for non-snapshot transactions because it allows them to start a snapshot that can be used later in the transaction for a statement-level snapshot operation.

Permissions

None.

Side effects

None.

See also
Standards and compatibility
  • SQL/2003   Vendor extension.