Deleting Keys

To delete an symmetric key in SQL Server use this SQL statement:

SQL Statement

DROP SYMMETRIC KEY <key name>

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

SQL Statement

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

DROP SYMMETRIC <key name> REMOVE PROVIDER KEY

For example:

SQL Statement

DROP SYMMETRIC KEY EKM_AES_256 REMOVE PROVIDER KEY

Use this SQL statement to delete an asymmetric key.

SQL Statement

DROP ASYMMETRIC KEY <key name> REMOVE PROVIDER KEY

For example:

SQL Statement

DROP ASYMMETRIC KEY EKM_RSA_2048 REMOVE PROVIDER KEY