Skip to content

Latest commit

 

History

History
90 lines (66 loc) · 2.9 KB

sp-srvrolepermission-transact-sql.md

File metadata and controls

90 lines (66 loc) · 2.9 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_srvrolepermission (Transact-SQL)
sp_srvrolepermission displays the permissions of a fixed server role.
VanMSFT
vanto
randolphwest
04/08/2024
sql
system-objects
reference
sp_srvrolepermission_TSQL
sp_srvrolepermission
sp_srvrolepermission
TSQL

sp_srvrolepermission (Transact-SQL)

[!INCLUDE SQL Server]

Displays the permissions of a fixed server role.

Important

[!INCLUDE ssNoteDepFutureAvoid]

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

Syntax

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

Arguments

[ @srvrolename = ] N'srvrolename'

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

Value 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 set

Column name Data type Description
ServerRole sysname Name of a fixed server role
Permission sysname Permission associated with ServerRole

Remarks

The permissions listed include the [!INCLUDE tsql] 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.

Permissions

Requires membership in the public role.

Examples

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

EXEC sp_srvrolepermission 'sysadmin';
GO

Related content