ROLLBACK TO SAVEPOINT Statement

Cancels any changes made since a SAVEPOINT.

Syntax

ROLLBACK TO SAVEPOINTsavepoint-name ]

Usage

The ROLLBACK TO SAVEPOINT statement will undo any changes that have been made since the SAVEPOINT was established.

Changes made prior to the SAVEPOINT are not undone; they are still pending.

The savepoint-name is an identifier that was specified on a SAVEPOINT statement within the current transaction. If savepoint-name is omitted, the most recent savepoint is used. Any savepoints since the named savepoint are automatically released.

Standards

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Savepoints are not supported by Adaptive Server Enterprise. To implement similar features in an Adaptive Server Enterprise-compatible manner, you can use nested transactions.

Permissions

There must have been a corresponding SAVEPOINT within the current transaction.

Related reference
RELEASE SAVEPOINT Statement
ROLLBACK Statement
SAVEPOINT Statement