sp_role

Description

Grants or revokes roles to an Adaptive Server login account.

Syntax

sp_role {"grant" | "revoke"}, rolename, loginame

Parameters

grant | revoke

specifies whether to grant the role to or revoke the role from loginame.

rolename

is the role to be granted or revoked.

loginame

is the login account to or from which the role is to be granted or revoked.

Examples

Example 1

Grants the System Administrator role to the login account named “alexander”:

sp_role "grant", sa_role, alexander

Usage

Permissions

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.

See also

Commands grant, revoke, set

Functions proc_role

System procedures sp_displaylogin