Creates a group in the current database.
sp_addgroup grpname
where
Groups are used as collective names for granting and revoking permissions.
The sp_addgroup system stored procedure adds an entry for the new group to a database's sysusers table. Each group's uid is a number greater than or equal to 16,384 (except the uid of the public group, which is always 0).
Once a group has been created, you can use the group name as an optional parameter with the sp_adduser system stored procedure, which adds the new user to a group at the same time as it is created. To add an already existing user to a group, use the sp_changegroup system stored procedure.
There is a built-in group, public, in every database. Each user automatically belongs to public and can be added to only other group. You cannot remove a user from the public group.
This example creates an accounting group.
sp_addgroup accounting
Execute permission defaults to the database owner.
sysusers
GRANT | sp_changegroup |
REVOKE | sp_dropgroup |
sp_adduser | sp_helpgroup |