Active statements

Active statements#

Active statement screen displays a list of currently running statements.

The screen can be accessed by selecting MONITOR ‣ Active statements section from the main menu .

Statements list can be refreshed by clicking the Refresh button in the top right corner.

Active statements

Column name

Description

Duration

How long statement is running

Status

Shows current status of running statement

User name

Name of user who executed statement

Statement SQL

SQL of executed statement ( the whole SQL is available on statement details screen)

Actions

Cancel button for running statement

Clicking on cancel button will cancel running statement. Selecting an element from the list will open new panel with details of the statement.

Running statement#

Selected active statement details: - duration, - status, - full SQL statement.

To cancel execution of the selected running statement, click the CANCEL STATEMENT button.

In SQL#

The same information is available through dynamic management views — sys.dm_exec_requests joined with sys.dm_exec_sessions:

SELECT r.session_id, r.status, r.command, r.start_time, s.login_name
  FROM sys.dm_exec_requests AS r
  JOIN sys.dm_exec_sessions  AS s ON s.session_id = r.session_id;

Cancel a running statement by its session id with KILL — the SQL equivalent of the CANCEL STATEMENT button:

KILL 53;