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



Hi Dan,

I actually have already tried them. The sp_helprolemember will require me
to insert the result into a temporary table and then verify.
The sys.database_role_members view will need to join with
sys.database_principals view. I wonder why there is no built-in security
function for such basic operation.

"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.


.



Relevant Pages