Deleting Keys

To delete a symmetric key in SQL Server, use this SQL statement:

SQL Statement

SQL
DROP SYMMETRIC KEY <key name>

For asymmetric keys use ASYMMETRIC instead of SYMMETRIC in the SQL statement:

SQL Statement

SQL
DROP ASYMMETRIC KEY <key name>

With the previous statements an internal SQL Server key or a binding to a key in an EKM provider is deleted. In the latter case, the key itself is still existing in the EKM provider. To delete both the binding and the EKM provider key use the following statement for a symmetric key:

SQL Statement

SQL
DROP SYMMETRIC <key name> REMOVE PROVIDER KEY

For Example

SQL Statement

SQL
DROP SYMMETRIC KEY EKM_AES_256 REMOVE PROVIDER KEY

Use this SQL statement to delete an asymmetric key.

Unknown Attachment SQL Statement

SQL
DROP ASYMMETRIC KEY <key name> REMOVE PROVIDER KEY

For Example

SQL Statement

SQL
DROP ASYMMETRIC KEY EKM_RSA_2048 REMOVE PROVIDER KEY