Drops a group from a database.
sp_dropgroup grpname
is the name of a group in the current database.
The “purchasing” group has merged with the “accounting” group. These commands move “martha” and “george”, members of the “purchasing” group, to other groups before dropping the group. The group name “public” is quoted because “public” is a reserved word:
sp_changegroup accounting, martha sp_changegroup "public", george sp_dropgroup purchasing
Executing sp_dropgroup drops a group name from a database’s sysusers table.
You cannot drop a group if it has members. You must execute sp_changegroup for each member before you can drop the group.
The permission checks for sp_dropgroup differ based on your granular permissions settings.
Granular permissions enabled |
With granular permissions enabled, you must be a user with manage any user privilege. |
Granular permissions disabled |
With granular permissions disabled, you must be the database owner, a user with sa_role , or a user with sso_role. |
Values in event and extrainfo columns from the sysaudits table are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
38 |
exec_procedure |
Execution of a procedure |
|
System procedures sp_addgroup, sp_changegroup, sp_helpgroup