Re: How to view the contents of a Database Role



Thanks, that will work perfectly.

-Chris

"Russell Fields" wrote:

Chris,

What to you mean by 'contents'?

For members of the role:
EXEC sp_helprolemember 'rolename'

For rights granted to the role:
EXEC sp_helprotect @username='rolename'

Or, in SQL Server 2005 and up you can use dynamic management views, such as:

-- Role members
select u.name DatabaseRole, u2.name Member
from sys.database_role_members m
join sys.database_principals u on m.role_principal_id = u.principal_id
join sys.database_principals u2 on m.member_principal_id = u2.principal_id
order by DatabaseRole, Member

-- Rights granted
select u.name principal_name, p.permission_name, p.class_desc,
object_name(p.major_id) ObjectName, state_desc from sys.database_permissions
p join sys.database_principals u
on p.grantee_principal_id = u.principal_id
WHERE p.permission_name <> 'CONNECT'
order by principal_name, ObjectName, p.permission_name

RLF

"Chris" <Chris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0F2BF39C-6951-4A2F-9152-772C8F8A3E00@xxxxxxxxxxxxxxxx
How do I view the contents of a database role I created?

-Chris



.



Relevant Pages

  • Re: how does an exec meeting work?
    ... The exec should be very very keen on you attending. ... The Group Scout Council is the electoral body, ... Group Scout Fellowship members; ... the maintenance of the Group's property and equipment; ...
    (uk.rec.scouting)
  • Re: problems with leaders - advice appreciated
    ... >>> Go check your constitution regarding the position of your Exec members. ... The chairman has no more say in fiscal matters than ... I do believe it because that is how an effective committee works. ...
    (uk.rec.scouting)
  • Re: Big problem fetching members from dynamically loaded module
    ... > make your program harder to understand and more likely to fail in obscure ... and I want their members in the menus if they are installed. ... > to ensure that evaland exec share the same namespace. ...
    (comp.lang.python)
  • Re: charity hiccup (2)
    ... > on the Exec. ... > showing all your trustees. ... POR Rule 23.3bii says that Leaders are members of the Exec. ... Many Groups think that by not registering they can be exempted from CC rules. ...
    (uk.rec.scouting)
  • Re: If you could....
    ... up nominations each year who are preferably not uniformed members. ... In the past we had a large exec too. ... to ask for nominations from Groups - I think that stopped a long time ago. ... many and it was getting like a leaders meeting with too much of that being ...
    (uk.rec.scouting)