> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW SAVEPOINT STATUS

The `SHOW SAVEPOINT STATUS` [statement](/docs/stable/sql-statements.md) lists the active [savepoints](/docs/stable/savepoint.md) in the current [transaction](/docs/stable/transactions.md).

## Required privileges

No [privileges](/docs/stable/security-reference/authorization.md#managing-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](https://mintcdn.com/cockroachlabs/UZNSFbmU2EwEm6G5/images/sql-diagrams/common/show_savepoint_status.svg?fit=max\&auto=format\&n=UZNSFbmU2EwEm6G5\&q=85\&s=712ce8064a4f410864a7b35155b88b6e)

## Response

The following fields are returned for each savepoint.

| Field | Description |
| - | - |
| `savepoint_name` | The name of the savepoint. |
| `is_initial_savepoint` | Whether the savepoint is the outermost savepoint in the transaction. |

## Example

1. Open a [transaction](/docs/stable/transactions.md) using [`BEGIN`](/docs/stable/begin-transaction), and create a [nested transaction](/docs/stable/transactions.md#nested-transactions) using a [savepoint](/docs/stable/savepoint.md):

   ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
   > BEGIN;
   SAVEPOINT foo;
   ```

2. Use the `SHOW SAVEPOINT STATUS` statement to list the active savepoints in the current nested transaction.

   ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
   > SHOW SAVEPOINT STATUS;
   ```

   ```
     savepoint_name | is_initial_savepoint
   -----------------+-----------------------
     foo            |        true
   (1 row)
   ```

   Currently, there is only one savepoint.

3. Commit this nested transaction by issuing the [`RELEASE SAVEPOINT`](/docs/stable/release-savepoint) statement, then clear the connection for the next transaction by issuing a [`COMMIT`](/docs/stable/commit-transaction) statement:

   ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
   > RELEASE SAVEPOINT foo;
   COMMIT;
   ```

   If we did not want to commit this nested transaction, but restart it instead, we would have issued a [`ROLLBACK TO SAVEPOINT`](/docs/stable/rollback-transaction#rollback-a-nested-transaction).

## See also

* [`SAVEPOINT`](/docs/stable/savepoint)
* [`RELEASE SAVEPOINT`](/docs/stable/release-savepoint)
* [`ROLLBACK`](/docs/stable/rollback-transaction)
* [`BEGIN`](/docs/stable/begin-transaction)
* [`COMMIT`](/docs/stable/commit-transaction)
* [Transactions](/docs/stable/transactions.md)
