I am using SQL Server 2005, I want to find out what all the grants are on a specific database for all tables. It would also help to find out all tables where the delete gran
To list all the permissions that can be controlled you can use the function fn_my_permission
. This query lists all permissions on server:
select * from fn_my_permissions(NULL, NULL)
You have to login using an account that has sysadmin role.
You can refine the function calls using following parameters.
For all permissions on database:
select * from fn_my_permissions(NULL, 'database')
For all permissions on the dbo schema:
select * from fn_my_permissions('dbo', 'schema')
For all permissions on a table:
select * from fn_my_permissions('dbo.test', 'object')