DENY Symmetric Key Permissions (Transact-SQL)
DENY permission [ ,...n ]
ON SYMMETRIC KEY :: symmetric_key_name
TO <database_principal> [ ,...n ] [ CASCADE ]
[ AS <database_principal> ]
Specifies a permission that can be denied on a symmetric key. For a list of the permissions, see the Remarks section later in this topic.
ON SYMMETRIC KEY :: asymmetric_key_name
Specifies the symmetric key on which the permission is being denied. The scope qualifier (::) is required.
TO < database_principal>
Specifies the principal from which the permission is being revoked.
Indicates that the permission being denied is also denied to other principals to which it has been granted by this principal.
Specifies a principal from which the principal executing this query derives its right to deny the permission.
Specifies a database user.
Specifies a database role.
Specifies an application role.
Specifies a database user mapped to a Windows user.
Specifies a database user mapped to a Windows group.
Specifies a database user mapped to a certificate.
Specifies a database user mapped to an asymmetric key.
Specifies a database user with no corresponding server-level principal.
Information about symmetric keys is visible in the
sys.symmetric_keys catalog view.
A symmetric key is a database-level securable contained by the database that is its parent in the permissions hierarchy. The most specific and limited permissions that can be denied on a symmetric key are listed in the following table, together with the more general permissions that include them by implication.
Symmetric key permission
Implied by symmetric key permission
Implied by database permission
ALTER ANY SYMMETRIC KEY
Requires CONTROL permission on the symmetric key or ALTER ANY SYMMETRIC KEY permission on the database. If you use the AS option, the specified principal must own the symmetric key.
The following example denies
ALTER permission on the symmetric key SamInventory42 to the database user HamidS.
DENY ALTER ON SYMMETRIC KEY::SamInventory42 TO HamidS;