sql-serveruser-permissionssymmetric-key

How to check who has access to symmetric keys in SQL Server


I would like to know all the users that have access to symmetric keys and the type of access they have. Can you please let me know how I can do this?


Solution

  • Maybe this query can help:

    select u.name, p.permission_name, p.class_desc, 
        object_name(p.major_id) ObjectName, state_desc 
    from sys.database_permissions  p join sys.database_principals u
    on p.grantee_principal_id = u.principal_id
    where class_desc = 'SYMMETRIC_KEYS'