show_role

Description

Displays the currently active system-defined roles of the current login.

Syntax

show_role()

Parameters

None.

Examples

Example 1

select show_role()
sa_role sso_role oper_role replication_role

Example 2

if charindex("sa_role", show_role()) >0
begin
    print "You have sa_role"
end

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute show_role.

See also

Commands alter role, create role, drop role, grant, set, revoke

Documentation Transact-SQL Users Guide

Functions proc_role, role_contain

System procedures sp_activeroles, sp_displayroles, sp_role