Skip to main content
The SHOW SAVEPOINT STATUS statement lists the active savepoints in the current transaction.

Required privileges

No privileges are required to create or show a savepoint. However, privileges are required for each statement within a transaction.

Synopsis

show_savepoint_status syntax diagram SQL syntax diagram

Response

The following fields are returned for each savepoint.

Example

  1. Open a transaction using BEGIN, and create a nested transaction using a savepoint:
  2. Use the SHOW SAVEPOINT STATUS statement to list the active savepoints in the current nested transaction.
    Currently, there is only one savepoint.
  3. Commit this nested transaction by issuing the RELEASE SAVEPOINT statement, then clear the connection for the next transaction by issuing a COMMIT statement:
    If we did not want to commit this nested transaction, but restart it instead, we would have issued a ROLLBACK TO SAVEPOINT.

See also