ROLLBACK TRANSACTION Statement [T-SQL]

Cancels any changes made since a SAVE TRANSACTION.

Syntax

ROLLBACK TRANSACTIONsavepoint-name ]

Examples

Usage

ROLLBACK TRANSACTION undoes any changes that have been made since a savepoint was established using SAVE TRANSACTION. Changes made prior to the SAVE TRANSACTION are not undone; they are still pending.

The savepoint-name is an identifier that was specified on a SAVE TRANSACTION statement within the current transaction. If savepoint-name is omitted, all outstanding changes are rolled back. Any savepoints since the named savepoint are automatically released.

Standards

  • Vendor extension to ISO/ANSI SQL grammar.

Permissions

There must be a corresponding SAVE TRANSACTION within the current transaction.

Related reference
BEGIN TRANSACTION Statement [T-SQL]
SAVE TRANSACTION Statement [T-SQL]