sp_helpsrvrole

Transact-SQL Reference

Transact-SQL Reference

sp_helpsrvrole

Returns a list of the Microsoft® SQL Server™ fixed server roles.

Syntax

sp_helpsrvrole [ [ @srvrolename = ] 'role' ]

Arguments

[@srvrolename =] 'role'

Is the name of the fixed server role. role is sysname, with a default of NULL, and can be any of these 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
Return Code Values

0 (success) or 1 (failure)

Result Sets
Column name Data type Description
ServerRole sysname Name of the server role
Description sysname Description of ServerRole

Remarks

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.

The table shows stored procedures that can be used to modify server roles.

Stored procedure Action
sp_addsrvrolemember Adds a login account to a fixed server role.
sp_helpsrvrolemember Displays a list of the members of a fixed server role.
sp_dropsrvrolemember Removes a member of a server role.

Permissions

Execute permissions default to the public role.

Examples

This example shows the list of available fixed server roles.

EXEC sp_helpsrvrole

See Also

sp_addsrvrolemember

sp_dropsrvrolemember

sp_helpsrvrolemember

System Stored Procedures