role_id

Description

Returns the role ID of the specified role name.

Syntax

role_id("role_name")

Parameters

role_name

is the name of a system or user-defined role. Role names and role IDs are stored in the syssrvroles system table.

Examples

Example 1

Returns the system role ID of sa_role:

select role_id("sa_role")
------
0

Example 2

Returns the system role ID of the “intern_role”:

select role_id("intern_role")
------
6

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute role_id.

See also

Documents For more information about .

Functions mut_excl_roles,proc_role,role_contain, role_name