Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

sp_helprolemember (Transact-SQL)


Applies To: SQL Server 2014, SQL Server 2016 Preview

Returns information about the direct members of a role in the current database.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions

sp_helprolemember [ [ @rolename = ] 'role' ]

[ @rolename = ] ' role '

Is the name of a role in the current database. role is sysname, with a default of NULL. role must exist in the current database. If role is not specified, then all roles that contain at least one member from the current database are returned.

0 (success) or 1 (failure)

Column name

Data type




Name of the role in the current database.



Name of a member of DbRole.



Security identifier of MemberName.

If the database contains nested roles, MemberName may be the name of a role. sp_helprolemember does not show membership obtained through nested roles. For example if User1 is a member of Role1, and Role1 is a member of Role2, EXEC sp_helprolemember 'Role2'; will return Role1, but not the members of Role1 (User1 in this example). To return nested memberships, you must execute sp_helprolemember repeatedly for each nested role.

Use sp_helpsrvrolemember to display the members of a fixed server role.

Use IS_ROLEMEMBER (Transact-SQL) to check role membership for a specified user.

Requires membership in the public role.

The following example displays the members of the Sales role.

EXEC sp_helprolemember 'Sales';
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft