Created
August 22, 2023 21:44
-
-
Save benrobot/759084ed8f3763893b40d66211b86049 to your computer and use it in GitHub Desktop.
Spell out permissions explicitly granted at the database level
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE MyDatabaseName | |
GO | |
SELECT CONCAT( | |
USER_NAME(grantee_principal_id) | |
,' is ' | |
,state_desc | |
,'ED permission to ' | |
,[permission_name] | |
,' on object ' | |
,USER_NAME(grantor_principal_id) | |
,'.' | |
,OBJECT_NAME(major_id) | |
) AS [Meaning] | |
FROM sys.database_permissions | |
WHERE USER_NAME(grantee_principal_id) <> 'public' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment