Updated on 2024-04-28 GMT+08:00

Terminating an Ongoing SQL Query

You can terminate an ongoing SQL query on the SQL Terminal tab page of Data Studio.

To terminate an ongoing SQL query, perform the following steps:

  1. Execute a SQL query on the SQL Terminal tab page.
  2. Click or press Shift+Esc.

    You can also choose Run > Cancel, or right-click in the code area and choose Cancel, or click Cancel on the Progress View tab page.

After you terminate an ongoing query, the SQL statement being executed is stopped.

Database changes made by the canceled query are rolled back and the following queries will not be executed.

A query cannot be canceled and the Result tab displays the result when:

  1. The query has been executed and the result is being generated.
  2. The result of the executed query is being transferred from the server to the Data Studio client.

A query cannot be canceled when you are viewing the execution plan of a query. For details, see Viewing the Execution Plan and Costs.

The Messages tab displays a message indicating that the query has been cancelled.

The Cancel option is enabled only when a query is being executed.