sp_srvrolepermission (Transact-SQL)


THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Displays the permissions of a fixed server role.

System_CAPS_ICON_important.jpg Important

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

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

Topic link icon Transact-SQL Syntax Conventions

sp_srvrolepermission [ [ @srvrolename = ] 'role']  

[ @srvrolename = ] 'role'
Is the name of the fixed server role for which permissions are returned. role is sysname, with a default of NULL. If no role is specified, the permissions for all fixed server roles are returned. role can have one of the following values.

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 a fixed server role
PermissionsysnamePermission associated with ServerRole

The permissions listed include the Transact-SQL statements that can be executed, and other special activities that can be performed by members of the fixed server role. To display a list of the fixed server roles, execute sp_helpsrvrole.

The sysadmin fixed server role has the permissions of all the other fixed server roles.

Requires membership in the public role.

The following query returns the permissions associated with the sysadmin fixed server role.

EXEC sp_srvrolepermission 'sysadmin';  

Security Stored Procedures (Transact-SQL)
sp_addsrvrolemember (Transact-SQL)
sp_dropsrvrolemember (Transact-SQL)
sp_helpsrvrole (Transact-SQL)
System Stored Procedures (Transact-SQL)

Community Additions