sp_dbfixedrolepermission (Transact-SQL)sp_dbfixedrolepermission (Transact-SQL)

适用于: 是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: YesSQL Server NoAzure SQL Database NoAzure Synapse Analytics (SQL DW) NoParallel Data Warehouse

显示固定数据库角色的权限。Displays the permissions of a fixed database role. sp_dbfixedrolepermission将在中返回SQL Server 2000 (8.x)SQL Server 2000 (8.x)正确的信息。sp_dbfixedrolepermission returns correct information in SQL Server 2000 (8.x)SQL Server 2000 (8.x). 该输出不反映对 SQL Server 2005 (9.x)SQL Server 2005 (9.x) 中实现的权限层次结构的更改。The output does not reflect the changes to the permissions hierarchy that were implemented in SQL Server 2005 (9.x)SQL Server 2005 (9.x). 有关详细信息,请参阅数据库级角色,其中显示固定数据库角色的列表及其相应权限。For more information, see Database-Level Roles, which shows a list of fixed database roles and it's corresponding permissions.


此功能处于维护模式并且可能会在 Microsoft SQL Server 将来的版本中被删除。This feature is in maintenance mode and may 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.

主题链接图标 Transact-SQL 语法约定Topic link icon Transact-SQL Syntax Conventions


sp_dbfixedrolepermission [ [ @rolename = ] 'role' ]  


[ @rolename = ] 'role'有效SQL ServerSQL Server的固定数据库角色的名称。[ @rolename = ] 'role' Is the name of a valid SQL ServerSQL Server fixed database role. role的值为sysname,默认值为 NULL。role is sysname, with a default of NULL. 如果未指定role ,将显示所有固定数据库角色的权限。If role is not specified, the permissions for all fixed database roles are displayed.

返回代码值Return Code Values

0(成功)或 1(失败)0 (success) or 1 (failure)

结果集Result Sets

列名称Column name 数据类型Data type 说明Description
DbFixedRoleDbFixedRole sysnamesysname 固定数据库角色的名称Name of the fixed database role
权限Permission nvarchar (70)nvarchar(70) DbFixedRole关联的权限Permissions associated with DbFixedRole


若要显示固定数据库角色的列表,请执行sp_helpdbfixedroleTo display a list of the fixed database roles, execute sp_helpdbfixedrole. 下表显示了固定数据库角色。The following table shows the fixed database roles.

固定数据库角色Fixed database role 说明Description
db_ownerdb_owner 数据库所有者Database owners
db_accessadmindb_accessadmin 数据库访问管理员Database access administrators
db_securityadmindb_securityadmin 数据库安全管理员Database security administrators
db_ddladmindb_ddladmin 数据库数据定义语言 (DDL) 管理员Database data definition language (DDL) administrators
db_backupoperatordb_backupoperator 数据库备份操作员Database backup operators
db_datareaderdb_datareader 数据库数据读取者Database data readers
db_datawriterdb_datawriter 数据库数据写入者Database data writers
db_denydatareaderdb_denydatareader 数据库拒绝数据读取者Database deny data readers
db_denydatawriterdb_denydatawriter 数据库拒绝数据写入者Database deny data writers

Db_owner固定数据库角色的成员拥有所有其他固定数据库角色的权限。Members of the db_owner fixed database role have the permissions of all the other fixed database roles. 若要显示固定服务器角色的权限,请执行sp_srvrolepermissionTo display the permissions for fixed server roles, execute sp_srvrolepermission.

结果集包括可执行的 Transact-SQLTransact-SQL 语句和该数据库角色的成员可执行的其他特殊操作。The result set includes the Transact-SQLTransact-SQL statements that can be executed, and other special activities that can be performed, by members of the database role.


要求 公共 角色具有成员身份。Requires membership in the public role.


以下查询将返回所有固定数据库角色的权限,因为该查询未指定固定数据库角色。The following query returns the permissions for all fixed database roles because it does not specify a fixed database role.

EXEC sp_dbfixedrolepermission;  

另请参阅See Also

安全存储过程 (Transact-sql) Security Stored Procedures (Transact-SQL)
sp_addrolemember (Transact-SQL) sp_addrolemember (Transact-SQL)
sp_droprolemember (Transact-sql) sp_droprolemember (Transact-SQL)
sp_helpdbfixedrole (Transact-sql) sp_helpdbfixedrole (Transact-SQL)
sp_srvrolepermission (Transact-sql) sp_srvrolepermission (Transact-SQL)
系统存储过程 (Transact-SQL)System Stored Procedures (Transact-SQL)