Grants or revokes roles to an Adaptive Server login account.
sp_role {"grant" | "revoke"}, rolename, loginame
specifies whether to grant the role to or revoke the role from loginame.
is the role to be granted or revoked.
is the login account to or from which the role is to be granted or revoked.
Grants the System Administrator role to the login account named “alexander”:
sp_role "grant", sa_role, alexander
sp_role grants or revokes roles to an Adaptive Server login account.
When you grant a role to a user, it takes effect the next time the user logs into Adaptive Server. Alternatively, the user can enable the role immediately by using the set role command. For example, the command enables the System Administrator role for the user:
set role sa_role on
You cannot revoke a role from a user while the user is logged in.
When users log in, all roles that have been granted to them are active (on). To turn a role off, use the set command. For example, to deactivate the System Administrator role, use the command:
set role "sa_role" off
Only a System Administrator can execute sp_role to grant the System Administrator role to other users. Only a System Security Officer can execute sp_role to grant any role other than “sa” to other users.
Functions proc_role
System procedures sp_displaylogin