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

# SHOW SAVEPOINT STATUS

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

The `SHOW SAVEPOINT STATUS` <InternalLink path="sql-statements">statement</InternalLink> lists the active <InternalLink path="savepoint">savepoints</InternalLink> in the current <InternalLink path="transactions">transaction</InternalLink>.

## Required privileges

No <InternalLink path="security-reference/authorization#managing-privileges">privileges</InternalLink> are required to create or show a savepoint. However, privileges are required for each statement within a transaction.

## Synopsis

<img src="https://mintcdn.com/cockroachlabs/M1Nto-joXUTgisRs/images/sql-diagrams/v25.3/show_savepoint_status.svg?fit=max&auto=format&n=M1Nto-joXUTgisRs&q=85&s=4691470a0b2ebb45626ec20c3d0a2b2d" alt="show_savepoint_status syntax diagram" style={{maxWidth: "100%", overflowX: "auto"}} width="335" height="37" data-path="images/sql-diagrams/v25.3/show_savepoint_status.svg" />

## 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 <InternalLink path="transactions">transaction</InternalLink> using <InternalLink path="begin-transaction">`BEGIN`</InternalLink>, and create a <InternalLink path="transactions#nested-transactions">nested transaction</InternalLink> using a <InternalLink path="savepoint">savepoint</InternalLink>:

   ```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 <InternalLink path="release-savepoint">`RELEASE SAVEPOINT`</InternalLink> statement, then clear the connection for the next transaction by issuing a <InternalLink path="commit-transaction">`COMMIT`</InternalLink> 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 <InternalLink path="rollback-transaction#rollback-a-nested-transaction">`ROLLBACK TO SAVEPOINT`</InternalLink>.

## See also

* <InternalLink path="savepoint">`SAVEPOINT`</InternalLink>
* <InternalLink path="release-savepoint">`RELEASE SAVEPOINT`</InternalLink>
* <InternalLink path="rollback-transaction">`ROLLBACK`</InternalLink>
* <InternalLink path="begin-transaction">`BEGIN`</InternalLink>
* <InternalLink path="commit-transaction">`COMMIT`</InternalLink>
* <InternalLink path="transactions">Transactions</InternalLink>
