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');
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: