Friday, March 23, 2012

Retrieving user roles

Since I can't find this information anywhere, I assume I'm about to ask a
pretty stupid question :)
Is there any way in T-SQL to retrieve a list of users who belong to a
particular role? And would this method work if the base method of
authentication was Windows Authentication?
Thanks
Mike.sp_helprolemember <role>
will list out the users within a role.
"Mike Ashton" <MikeAshton@.community.nospam> wrote in message
news:OjTI5PuWFHA.1404@.TK2MSFTNGP09.phx.gbl...
> Since I can't find this information anywhere, I assume I'm about to ask a
> pretty stupid question :)
> Is there any way in T-SQL to retrieve a list of users who belong to a
> particular role? And would this method work if the base method of
> authentication was Windows Authentication?
> Thanks
> Mike.
>|||It's
EXEC sp_helprolemember '<role name>'
for database roles
and
EXEC sp_helpsrvrolemember '<role name>'
for fixed server roles.
Jacco Schalkwijk
SQL Server MVP
"Mike Ashton" <MikeAshton@.community.nospam> wrote in message
news:OjTI5PuWFHA.1404@.TK2MSFTNGP09.phx.gbl...
> Since I can't find this information anywhere, I assume I'm about to ask a
> pretty stupid question :)
> Is there any way in T-SQL to retrieve a list of users who belong to a
> particular role? And would this method work if the base method of
> authentication was Windows Authentication?
> Thanks
> Mike.
>

No comments:

Post a Comment