Skip to content

Instantly share code, notes, and snippets.

@phaniav
Last active March 15, 2020 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phaniav/8a5c7473ad4496f3997f241defb16f9e to your computer and use it in GitHub Desktop.
Save phaniav/8a5c7473ad4496f3997f241defb16f9e to your computer and use it in GitHub Desktop.
select princ.name
, princ.type_desc
, perm.permission_name
, perm.state_desc
, perm.class_desc
, object_name(perm.major_id)
from sys.database_principals princ
left join
sys.database_permissions perm
on perm.grantee_principal_id = princ.principal_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment