Partilhar via


sp_srvrolepermission (Transact-SQL)

Displays the permissions of a fixed server role.

Note

sp_srvrolepermission returns information that is correct in SQL Server 2000. The output does not reflect changes to the permissions hierarchy that is implemented in SQL Server 2005. For more information, see Permissions of Fixed Server Roles.

Topic link iconTransact-SQL Syntax Conventions

Syntax

sp_srvrolepermission [ [ @srvrolename = ] 'role']

Arguments

  • [ @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.

    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 Sets

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 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.

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

See Also

Reference

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

Help and Information

Getting SQL Server 2005 Assistance