Categories:

Account & Session DDL

DROP CONNECTION

Removes a connection from the account.

See also:

CREATE CONNECTION , SHOW CONNECTIONS

Syntax

DROP CONNECTION [ IF EXISTS ] <name>

Parameters

name

Specifies the identifier for the connection to drop. If the identifier contains spaces, special characters, or mixed-case characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive (e.g. "My Object").

Usage Notes

  • Only account administrators (users with the ACCOUNTADMIN role) can execute this SQL command.

  • A primary connection cannot be dropped if it has one or more secondary connections. To drop the primary connection, first promote a secondary connection to serve as the primary connection, and then drop the former primary connection. Alternatively, drop all of the secondary connections, and then drop the primary connection.

Examples

Drop a connection:

SHOW CONNECTIONS LIKE 't2%';


DROP CONNECTION t2;


SHOW CONNECTIONS LIKE 't2%';

Drop the connection again, but don’t raise an error if the connection does not exist:

DROP CONNECTION IF EXISTS t2;