Re: How to view the contents of a Database Role

Thanks, that will work perfectly.


"Russell Fields" wrote:


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 DatabaseRole, 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 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


"Chris" <Chris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
How do I view the contents of a database role I created?



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; ...
  • 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. ...
  • 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. ...
  • 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. ...
  • 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 ...