Categories:

System Functions (System Control)

SYSTEM$CANCEL_ALL_QUERIES¶

Cancels all active/running queries in the specified session.

See also:

SYSTEM$CANCEL_QUERY

Syntax¶

SYSTEM$CANCEL_ALL_QUERIES( <session_id> )
Copy

Arguments¶

session_id

Identifier for the session for which to cancel all queries. To obtain the ID for a session, log into the web interface as an account administrator (user with the ACCOUNTADMIN role) and go to:

Account Account tab » Sessions

Usage Notes¶

  • A user can cancel their own running SQL operations using this SQL function. Canceling running operations executed by another user requires a role with one of the following privileges:

    • OWNERSHIP on the user who executed the operation.

    • OPERATE or OWNERSHIP on the warehouse that is running the operation (if applicable).

    Note that the ACCOUNTADMIN role is not necessarily granted any of these privileges.

  • This function is not intended for canceling queries for a particular warehouse or user. Instead, use:

Examples¶

SELECT SYSTEM$CANCEL_ALL_QUERIES(1065153872298);

+------------------------------------------+
| SYSTEM$CANCEL_ALL_QUERIES(1065153872298) |
|------------------------------------------|
| 1 cancelled.                             |
+------------------------------------------+
Copy

For a more detailed, working example, see Canceling Statements.