DROP SYMMETRIC KEY (Transact-SQL)

Applies to: yesSQL Server (all supported versions) YesAzure SQL Database

Removes a symmetric key from the current database.

Topic link icon Transact-SQL Syntax Conventions

Syntax

DROP SYMMETRIC KEY symmetric_key_name [REMOVE PROVIDER KEY]  

Note

To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.

Arguments

symmetric_key_name
Is the name of the symmetric key to be dropped.

REMOVE PROVIDER KEY
Removes an Extensible Key Management (EKM) key from an EKM device. For more information about Extensible Key Management, see Extensible Key Management (EKM).

Remarks

If the asymmetric key is mapped to an Extensible Key Management (EKM) key on an EKM device and the REMOVE PROVIDER KEY option is not specified, the key will be dropped from the database but not the device, and a warning will be issued.

Permissions

Requires CONTROL permission on the symmetric key.

Examples

The following example removes a symmetric key named GailSammamishKey6 from the current database.

CLOSE SYMMETRIC KEY GailSammamishKey6;  
DROP SYMMETRIC KEY GailSammamishKey6;  
GO  

See Also

CREATE SYMMETRIC KEY (Transact-SQL)
CREATE SYMMETRIC KEY (Transact-SQL)
ALTER SYMMETRIC KEY (Transact-SQL)
Encryption Hierarchy
CLOSE SYMMETRIC KEY (Transact-SQL)
Extensible Key Management (EKM)