Changes the role membership of a user in the current database.
|sp_changegroup is provided for compatibility with earlier versions of Microsoft SQL Server. In new development work, use sp_addrolemember and sp_droprolemember instead.|
Roles provide a mechanism for managing the permissions applied to members of the role. When a user is added to a role, the user gains the permissions granted to the role.
When sp_changegroup is executed, the security account for user is added as a member of role, and removed from all other roles. To change role membership in a single role without affecting membership in other roles, use sp_addrolemember and sp_droprolemember.
New database users can be added to roles at the same time they are given access to the database with sp_adduser.
Every user is a member of the default role public.
sp_changegroup cannot be executed within a user-defined transaction.
The following example makes the user
Albert a member of the
EXEC sp_changegroup 'developers', 'Albert'