How do we know that whatever permissions given to a DATABASE/OBJECT/USER ?

Pandians
Posted by Pandians under Sql Server category on | Views : 2325
This script lists the permissions granted to the Current Database:  
SELECT permission_name 'DB Permission Lists' FROM FN_MY_PERMISSIONS(NULL, 'DATABASE')
ORDER BY subentity_name, permission_name


This script lists the permissions granted to an Object  
SELECT Entity_Name,permission_name 'Permission Lists' FROM FN_MY_PERMISSIONS('ObjectName', 'OBJECT')
WHERE SUBENTITY_NAME ='' ORDER BY subentity_name, permission_name ;


This script lists the permissions granted to an User  
SELECT Entity_Name,permission_name 'Permission Lists' FROM FN_MY_PERMISSIONS('UserName', 'USER')
ORDER BY subentity_name, permission_name ;

Comments or Responses

Login to post response