Adds a group to a database. Groups are used as collective names in granting and revoking privileges.
sp_addgroup grpname
is the name of the group. Group names must conform to the rules for identifiers.
Creates a group named accounting in the current database:
sp_addgroup accounting
sp_addgroup adds the new group to a database’s sysusers table. Each group’s user ID (uid) is 16384 or larger (except “public,” which is always 0).
A group and a user cannot have the same name.
Once a group has been created, add new users with sp_adduser. To add an existing user to a group, use sp_changegroup.
Every database is created with a group named “public”. Every user is automatically a member of “public”. Each user can be a member of one additional group.
Only the Database Owner, a System Administrator, or a System Security Officer can execute sp_addgroup.
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_adduser, sp_changegroup, sp_dropgroup, sp_helpgroup