IS THERE ANY COMMAND TO KNOW THE RIGHTS OF DB ROLES

  • We have the command for server roles to know the permissions..

    sp_srvrolepermission 'bulkadmin'

    it will give the permissions list of bulkadmin..in the same way we have any

    sp to find the permissions of db roles...?

  • the sys.database_permissions catalog view will give you which permissions are granted. join to the sys.database_principals to filter by role name.

    SELECT ob.type_desc, dp.permission_name, dp.state_desc,ObjectName = OBJECT_NAME(major_id), GranteeName = grantee.name, GrantorName = grantor.name

    FROM sys.database_permissions dp

    JOIN sys.database_principals grantee

    on dp.grantee_principal_id = grantee.principal_id

    JOIN sys.database_principals grantor

    on dp.grantor_principal_id = grantor.principal_id

    JOIN sys.objects ob

    on dp.major_id = ob.object_id

    where grantee.name = '<role_name>'

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply