role_contain

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

Syntax

role_contain("role1", "role2")

Parameters

Examples

Usage

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

See also:
  • alter role in Reference Manual: Commands

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

  • sp_activeroles, sp_displayroles in Reference Manual: Procedures

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute role_contain.

Related reference
mut_excl_roles
proc_role
role_id
role_name