show_role

Description

Shows the login’s currently active system-defined roles.

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

For general information about system functions, see “System functions”.

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

Functions proc_role, role_contain

System procedures sp_activeroles, sp_displayroles, sp_role