sp_helpsrvrolemember (Transact-SQL)


Returns information about the members of a SQL Server fixed server role.

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

Topic link icon Transact-SQL Syntax Conventions

sp_helpsrvrolemember [ [ @srvrolename = ] 'role' ]  

[ @srvrolename = ] 'role'
Is the name of a fixed server role. role is sysname, with a default of NULL. If roleis not specified, the result set includes information about all fixed server roles.

role can be any of the following values.

Fixed server roleDescription
sysadminSystem administrators
securityadminSecurity administrators
serveradminServer administrators
setupadminSetup administrators
processadminProcess administrators
diskadminDisk administrators
dbcreatorDatabase creators
bulkadminCan execute BULK INSERT statements

0 (success) or 1 (failure)

Column nameData typeDescription
ServerRolesysnameName of the server role
MemberNamesysnameName of a member of ServerRole
MemberSIDvarbinary(85)Security identifier of MemberName

Use sp_helprolemember to display the members of a database role.

All logins are a member of public. sp_helpsrvrolemember does not recognize the public role because, internally, SQL Server does not implement public as a role.

To add or removed members from server roles, see ALTER SERVER ROLE (Transact-SQL).

sp_helpsrvrolemember does not take a user-defined server role as an argument. To determine the members of a user-defined server role, see the examples in ALTER SERVER ROLE (Transact-SQL).

Requires membership in the public role.

The following example lists the members of the sysadmin fixed server role.

EXEC sp_helpsrvrolemember 'sysadmin';  

sp_helprole (Transact-SQL)
sp_helprolemember (Transact-SQL)
System Stored Procedures (Transact-SQL)
Security Stored Procedures (Transact-SQL)
Security Functions (Transact-SQL)

Community Additions