ALTER ROLE (TSQL Statement)
adds or removes a member to the specified role, or changes the role name.
Syntax
ALTER ROLE role_name WITH NAME = new_name
ALTER ROLE role_name
{ ADD MEMBER principal
| DROP MEMBER principal
}
Arguments
- role_name
- is the role name.
NAME =
new_name- is the new name of the role.
ADD MEMBER
principal- adds principal (user or role) to the role.
DROP MEMBER
principal- removes principal (user or role) from the role.
- principal
- is the user or role to add to the role, or remove from it.
Remarks
Only sa or dbo is allowed to execute this statement.
Examples
ALTER ROLE accountants WITH NAME = controlling;
ALTER ROLE controlling ADD MEMBER john;
ALTER ROLE controlling DROP MEMBER omer;