List All Users' Server Permissions

Pat Snow 111 Reputation points
2023-04-17T00:38:39.5233333+00:00

How do you get a list of all users' server permissions without using impersonation? This doesn't include all server permissions i.e. create database.

USE [master]
SELECT pr.principal_id, 
       pr.name, pr.type_desc,   
       pe.state_desc, 
       pe.permission_name   
FROM sys.server_principals AS pr   
JOIN sys.server_permissions AS pe 
    ON pe.grantee_principal_id = pr.principal_id
Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Martin Cairney 2,261 Reputation points
    2023-04-20T20:53:31.05+00:00

    Hi Pat
    Azure SQL Database as a PaaS service does not expose the Server-Level permissions that you would expect to see in the boxed product.
    There are some specific permissions/roles that exist as documented here. Note that the master database in Azure SQL Database is more of a logical concept because of the PaaS nature of the databases.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.