role_contain

Description

Determines whether a specified role is contained within another specified role.

Syntax

role_contain("role1", "role2")

Parameters

role1

is the name of a system or user-defined role.

role2

is the name of another system or user-defined role.

Examples

Example 1

select role_contain("intern_role", "doctor_role")
-----------
1

Example 2

select role_contain("specialist_role", "intern_role")
-----------
0

Usage

role_contain, a system function, returns 1 if role1 is contained by role2. Otherwise, role_contain returns 0.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute role_contain.

See also

Documents For more information about contained roles and role hierarchies, see the System Administration Guide. For system functions, see Transact-SQL Users Guide.

Functions mut_excl_roles, proc_role, role_id, role_name

Commands alter role

System procedures sp_activeroles, sp_displayroles, sp_role