Determines whether a specified role is contained within another specified role.
role_contain("role1", "role2")
select role_contain("intern_role", "doctor_role")
----------- 1
select role_contain("specialist_role", "intern_role")
----------- 0
role_contain, a system function, returns 1 if role1 is contained by role2. Otherwise, role_contain returns 0.
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
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute role_contain.