locked
Enumerate SQL Server Logins and Permissions RRS feed

  • Question

  •  

    Haven't been able to find the answer to this after sever searches.  So decided to open the thread myself.

     

    I am trying to write a report enumerating logins in SQL Server and all database-level and object-level permissions granted to each login.

     

    Can someone tell me what system objects I can query to fetch this information?

     

    TIA.

    Monday, September 10, 2007 9:00 PM

Answers

  •  

    Hi,

     You can get the results by querying the following system views(cata log views):

     

    Database-Level Views:


    sys.database_permissions
    sys.database_principals

     

    Server-Level Views:


    sys.server_permissions
    sys.sql_logins
    sys.server_principals 

     

    Thanks & Regards,

    Kiran.Y

     

     

    Monday, September 10, 2007 9:19 PM

All replies

  •  

    Hi,

     You can get the results by querying the following system views(cata log views):

     

    Database-Level Views:


    sys.database_permissions
    sys.database_principals

     

    Server-Level Views:


    sys.server_permissions
    sys.sql_logins
    sys.server_principals 

     

    Thanks & Regards,

    Kiran.Y

     

     

    Monday, September 10, 2007 9:19 PM
  • That's just what I was looking for.  Thanks much.

    Monday, September 10, 2007 11:09 PM