Follow sqlserver-dba.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

SQLServer-DBA.com Links

Dba_db2_button

dba-ninja.com

SQL Server DBA Jobs

How to get SQL Server Explicit Permssions for a Server Principal

01 April,2025 by Tom Collins

Query to return the SQL Server Explicit permissions for a specific Server Principal.

Useful if you want to identify GRANT,REVOKE,DENY for server principals 

 

SELECT @@SERVERNAME ,spri.name, spri.type_desc, sper.permission_name, sper.state_desc 
FROM sys.server_permissions sper 
INNER JOIN sys.server_principals spri 
ON sper.grantee_principal_id = spri.principal_id 
where spri.name = 'MyLoginID'

Some other related queries for SQL Server users and permissions

SQL Server user roles and permissions query

How to get user security changes with SQL default trace

 


Author: Tom Collins (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to get SQL Server Explicit Permssions for a Server Principal


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer