Re: How to verify whether a user has been added to a database role



Hi Dan,

I just realize that using those views are more complicated since the user
and the desired role may be related thru a hierarchy not a direct
relationship.

"Dan Guzman" wrote:

Try:

EXEC sp_helprolemember 'role_name_here'

In SQL 2005, you can also query from sys.database_role_members catalog view.



--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CC980BB7-8654-4F7C-84EB-0CB51E1F860C@xxxxxxxxxxxxxxxx
I want to validate whether a user has been added to a particular database
role. I cannot use the is_member function since it only works with the
current user.


.