How to get a list of users and their rights to the database???????????????

  • Hello,

    I'm trying to find information on how I would get a list of users in a database and their rights. I don't what to see their roles (can do that already) but their rights. Departments want to know each users rights that are not in a role/group.

    Any help would be great.

    Thanks in advance for your time and efforts.

    Rudy

  • Something like this?

    select  left(u.name,20),

     cast(o.name as varchar(45))as 'object',

     case p.action

              when 193 then 'SELECT'

       when 195 then 'INSERT'

       when 196 then 'DELETE'

       when 197 then 'UPDATE'

       when 224 then 'EXECUTE'

              else '  '

             end as 'permission'

    from sysprotects p join sysobjects o

    on o.id = p.id

    join sysusers u

    on p.uid = u.uid

    order by u.name

    Greg

    Greg

  • Thanks Greg but not really. Below is the output I'm looking for

    DB_Name: Northwind2

    User_Name: jsmtih

    Table_Name Access_Type

    Customers INSERT/UPDATE/DELETE

    Sales SELECT

    Address SELECT

    Something like this. What I don't understand is that auditors and managers alway as for this information yet there is very little on the net.

    Thanks again for your efforts,

    Rudy

    Rudy

  • sp_helprotects?

  • Yes! Thank you for all your time on this. Now I can make the auditors happy.

    Rudy

    Rudy

Viewing 5 posts - 1 through 4 (of 4 total)

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