drop role

Drops a user-defined role.

Syntax

drop role role_name [with override]

Parameters

Examples

Usage

  • You need not drop memberships before dropping a role. Dropping a role automatically removes any user’s membership in that role, regardless of whether you use the with override option.

  • Use drop role from the master database.

  • All rows corresponding to a dropped role are removed from the syspasswordhistory table.

You cannot use drop role to drop system roles.

See also sp_activeroles, sp_displaylogin, sp_displayroles, sp_helprotect in Reference Manual: Procedures.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

The permission checks for drop role differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be a user with manage roles privilege.

Disabled

With granular permissions disabled, you must be a user with sso_role.

Auditing

Values in event and extrainfo columns of sysaudits are:

InformationValues
Event

85

Audit option

roles

Command or access audited

create role, drop role, alter role, grant role, or revoke role

Information in extrainfo
  • Roles – current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

  • Proxy information – original login name, if set proxy is in effect

Related reference
alter role
create role
grant
revoke
set