Skip to content

Latest commit

 

History

History
93 lines (67 loc) · 3.21 KB

sp-helpsrvrolemember-transact-sql.md

File metadata and controls

93 lines (67 loc) · 3.21 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_helpsrvrolemember (Transact-SQL)
sp_helpsrvrolemember returns information about the members of a SQL Server fixed server role.
markingmyname
maghan
randolphwest
05/15/2024
sql
system-objects
reference
sp_helpsrvrolemember
sp_helpsrvrolemember_TSQL
sp_helpsrvrolemember
TSQL

sp_helpsrvrolemember (Transact-SQL)

[!INCLUDE SQL Server]

Returns information about the members of a [!INCLUDE ssNoVersion] fixed server role.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sp_helpsrvrolemember [ [ @srvrolename = ] N'srvrolename' ]
[ ; ]

Arguments

[ @srvrolename = ] N'srvrolename'

The name of a fixed server role. @srvrolename is sysname, with a default of NULL, and can be any of the following values.

Fixed server role Description
sysadmin System administrators
securityadmin Security administrators
serveradmin Server administrators
setupadmin Setup administrators
processadmin Process administrators
diskadmin Disk administrators
dbcreator Database creators
bulkadmin Can execute BULK INSERT statements

If @srvrolename isn't specified, the result set includes information about all fixed server roles.

Return code values

0 (success) or 1 (failure).

Result set

Column name Data type Description
ServerRole sysname Name of the server role
MemberName sysname Name of a member of ServerRole
MemberSID varbinary(85) Security identifier of MemberName

Remarks

Use sp_helprolemember to display the members of a database role.

All logins are a member of public. sp_helpsrvrolemember doesn't recognize the public role because, internally, [!INCLUDE ssNoVersion] doesn't implement public as a role.

To add or removed members from server roles, see ALTER SERVER ROLE.

sp_helpsrvrolemember doesn't 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.

Permissions

Requires membership in the public role.

Examples

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

EXEC sp_helpsrvrolemember 'sysadmin';

Related content