Share via


sp_helprolemember (Transact-SQL)

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

Topic link iconTransact-SQL Syntax Conventions

Syntax

sp_helprolemember [ [ @rolename = ] 'role' ]

Arguments

  • [ @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.

Return Code Values

0 (success) or 1 (failure)

Result Sets

Column name Data type Description

DbRole

sysname

Name of the role in the current database.

MemberName

sysname

Name of a member of DbRole.

MemberSID

varbinary(85)

Security identifier of MemberName.

Remarks

If the database contains nested roles, MemberName may be the name of a role.

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

Permissions

Requires membership in the public role.

Examples

The following example displays the members of the Sales role.

EXEC sp_helprolemember 'Sales'

See Also

Reference

Security Stored Procedures (Transact-SQL)
sp_addrolemember (Transact-SQL)
sp_droprolemember (Transact-SQL)
sp_helprole (Transact-SQL)
sp_helpsrvrolemember (Transact-SQL)
System Stored Procedures (Transact-SQL)

Help and Information

Getting SQL Server 2005 Assistance