Query to find the users and their persmissions in SQL Server Database

This query returns the users and their permissions in a database:

SELECT u.name as user_name, p.state_desc, p.permission_name

FROM sys.server_permissions AS p JOIN sys.server_principals AS u
ON p.grantee_principal_id = u.principal_id

If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">