Drops a user-defined role.
drop role role_name [with override]
drop role doctor_role
drop role doctor_role with override
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.
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for drop role differ based on your granular permissions settings.
Setting | Description |
---|---|
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. |
Values in event and extrainfo columns of sysaudits are:
Information | Values |
---|---|
Event | 85 |
Audit option | roles |
Command or access audited | create role, drop role, alter role, grant role, or revoke role |
Information in extrainfo |
|