.cancel query command

The .cancel query command starts a best-effort attempt to cancel a specific running query. Cluster admins can cancel any running query. Database admins can cancel any running query that was invoked on a database to which they have admin access. All principals can cancel running queries that they started.

Syntax

.cancel query ClientActivityId [with ( reason = ReasonPhrase )]

Learn more about syntax conventions.

Parameters

Name Type Required Description
ClientActivityId string ✔️ The value of the running query's ClientActivityId property. Find the ClientActivityId of a query by running the .show queries command.
ReasonPhrase string ✔️ Describes the reason for canceling the running query and is included in the query results if it's successfully canceled.

Example

This example cancels a specific query using ClientActivityId.

.cancel query "KE.RunQuery;8f70e9ab-958f-4955-99df-d2a288b32b2c"