find discount viagra online

Tuesday, October 21, 2014

Retrieve permissions on SQL Server database

August 22, 2010 by · Leave a Comment 

 

SQL Server permissions can be granted to on an object level (schema, database, database objects). In newer versions of SQL Server permissions can be given to user at a more granular level.

To retrieve all the permissions granted to a specific user SQL server has a function named: fn_my_permission.  This function is only accessible to system administrator. e.g

following query will retrieve all the permissions on server.

select * From fn_my_permissions(NULL, NULL) 

following query retrieve all the permissions on a database:

select * From fn_my_permissions(NULL, ‘database’)

 

following query retrieve all the permissions on a dbo schema:

select * From fn_my_permissions(’dbo’, ’schema’)

Top Blogs

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

*