A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  special characters  sybase-tech-blog


Category: ASE: Functions: User, Login and Role Functions

role_name()

The role function role_name() returns the name of the role declared in the parameter "role_id". The function role_name() is based on data stored in the system table syssrvroles.

Syntax of the Role Function role_name()

    role_name(role_id)
    

The parameter of the Role Function role_name()

role_id
The parameter "role_id" is a placeholder for the id of the role name.

Example for the Role Function role_name()

    select role_name(0)
go
-----
sa_role

Returns the id "0" of the role "sa_role".

By querying the system table master..syssrvroles all role names and their according ids can be displayed.

    select name, srid from master..syssrvroles

See also:
alter role,
create role,
drop role,
grant role,
revoke role,
set role,
has_role(),
proc_role(),
mut_excl_roles(),
role contain(),
role id(),
show_role(),
sp_activeroles,
sp_displayroles,
sp_role,
suser_id(),
suser_name(),
user,
user_id(),
user_name(),
valid_user() and
Functions.

See also:

ASE T-SQL - Aggregate Functions,
ASE T-SQL - User,
mut_excl_roles(),
proc_role(),
role_contain(),
role_id(),
show_role(),
suser_id(),
suser_name(),
user,
user_id(),
user_name(),
valid_name(),
valid_user().