Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find my permissions in a SQL Server database?

I'm a user of a SQL Sever database, and I want to know my access rights / permissions in the database I'm using. What SQL query should I use to do so?

Thanks

like image 579
Nbenz Avatar asked Mar 20 '18 17:03

Nbenz


People also ask

How can I see the permissions of a user in SQL Server?

Using SQL Server management studio:In the object explorer window, right click on the view and click on Properties. Navigate to the Permissions tab. Here you can see the list of users or roles who has access to the view. Also, you can see the type of access the user or role has.

How do I get list of Logins and permissions in SQL Server?

First, move to “Object Explorer” and expand the database that you want. Next, under the database, expand the “Security” directory. Now, under Security, expand the “Users” option. This will display a list that contains all the users created in that database.

Where are SQL permissions stored?

Server level permissions are stored in internal tables exposed through the sys. server_premissions catalog view. Database level permissions are stored in internal tables exposed through the sys. database_permissions catalog view.


1 Answers

I think the easiest way would be:

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

I tried it in SQL Server 2008.

Ref: https://docs.microsoft.com/en-us/sql/relational-databases/system-functions/sys-fn-my-permissions-transact-sql

like image 83
Eray Balkanli Avatar answered Oct 14 '22 00:10

Eray Balkanli