Export (0) Print
Expand All
Expand Minimize

sp_helpsrvrole (Transact-SQL)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Returns a list of the SQL Server fixed server roles.

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

Topic link icon Transact-SQL Syntax Conventions

sp_helpsrvrole [ [ @srvrolename = ] 'role' ]

[ @srvrolename= ] 'role'

Is the name of the fixed server role. role is sysname, with a default of NULL. role can be one of the following values.

Fixed server role



System administrators


Security administrators


Server administrators


Setup administrators


Process administrators


Disk administrators


Database creators


Can execute BULK INSERT statements

0 (success) or 1 (failure)

Column name

Data type




Name of the server role



Description of ServerRole

Fixed server roles are defined at the server level and have permissions to perform specific server-level administrative activities. Fixed server roles cannot be added, removed, or changed.

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

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

sp_helpsrvrole does not take a user-defined server role as an argument. To list the user-defined server roles, see the examples in ALTER SERVER ROLE (Transact-SQL).

Requires membership in the public role.

A. Listing the fixed server roles

The following query returns the list of fixed server roles.

EXEC sp_helpsrvrole ;

B. Listing fixed and user-defined server roles

The following query returns a list of both fixed and user-defined server roles.

SELECT * FROM sys.server_principals WHERE type = 'R' ;

C. Returning a description of a fixed server role

The following query returns the name and description of the diskadmin fixed server roles.

sp_helpsrvrole 'diskadmin' ;
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft