Changes a user's group.
sp_changegroup grpname, username
where
Groups provide a collective name that is used when granting and revoking permissions. A user can be a member of only one group, in addition to public.
The sp_changegroup system stored procedure adds the specified user to the specified group. The user is dropped from the group he or she belongs to and is added to the one specified by grpname. If you use public as the grpname parameter, it must be enclosed in quotation marks because PUBLIC is an SQL keyword.
New database users can be added to groups at the same time as they are given access to the database by sp_adduser.
Every user is a member of the default group public, if not explicitly added to some other group by sp_adduser or sp_changegroup.
This example makes Albert a member of the developers group. It doesn't matter which group Albert belonged to before.
sp_changegroup developers, Albert
Execute permission defaults to the database owner.
sysusers
GRANT | sp_adduser |
REVOKE | sp_dropgroup |
sp_addgroup | sp_helpgroup |