Retrieving Permissions for a login/user in SQL Server

By using the function “fn_my_permissions()” we can fetch the permissions that a login has at server level and at database level. This function returns a list of the permissions effectively granted to the principal on a securable.

Syntax:

fn_my_permissions ( securable , 'securable_class')

Fetching what permissions does a login has at Server level:

SELECT * FROM fn_my_permissions(NULL, 'SERVER');

Fetching what permissions does a user has at Database level:

SELECT * FROM fn_my_permissions(NULL, 'DATABASE');
Advertisements
  • Recent Posts

    • 458,621 hits
  • Join 37 other followers

  • Archives

  • Categories

  • May 2019
    M T W T F S S
    « Feb    
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Advertisements