MSSQL T-SQL to return all the login, return all the DB user and their permission

Elon Musk 161 Reputation points

Recently I have a audit project, need quried all the logins and its permissions. for example, if the login has sysadmin, it break policy and need to decrease the permission

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,009 questions
{count} votes

Accepted answer
  1. Rahul Randive 4,461 Reputation points Microsoft Employee

    Thanks for your question. 

    Please find reference document for queries listing all permission. 

    Similar thread and T-SQL Commands - 

    Let us know if this helps!


    Thank you!

    0 comments No comments

0 additional answers

Sort by: Most helpful