KILL CONNECTION

KILL CONNECTION — kill a long running transaction by killing the connection

Syntax

KILL CONNECTION [ NODEID num ] { CONNID | CONNECTION_ID } num

Description

Kill a connection by specifying a connection ID, as reported in the CONNID column in SYSTEM.CONNECTIONS, and optionally qualified by a node ID as reported in the NODEID column in SYSTEM.CONNECTIONS.

Parameters

Example

Step 1 Find query IDs in the SYSTEM.CONNECTIONS table

SELECT sqlstring, nodeid, connid FROM system.connections;  
 
            SQLSTRING              CONNID  NODEID
 --------------------------------- ------ --------
 
 select * from system.connections;   9      2          
                                     10     2

Step 2 Issue KILL CONNECTION using NODEID and CONNID

KILL CONNECTION NODEID 2 CONNID 10;
 
# Select from system.connections again:
SELECT sqlstring, nodeid, connid FROM system.connections;  
 
            SQLSTRING              CONNID  NODEID
 --------------------------------- ------ --------
 
 select * from system.connections;   9      2