|
Category: ASE: Functions: User, Login and Role Functions
suser_name()
The
user function
suser_name()
returns the login name of the suid specified in the
parameter "suid" as stored in the
system table
syslogins.
"suid" is short for "server user id".
Syntax of the User Function suser_name()
The parameter of the User Function suser_name()
suid
The parameter "suid" is a placeholder for a
suid,
this means the unique identifier assigned automatically with the die mit der
System Procedure
sp_addlogin
and which is stored in the system table syslogins.
If the parameter remains unset, the
login name
of the currently logged in
user
is returned. If the specified suid does not yet exist, the return value is
NULL.
Example for the User Function suser_name()
select suser_name()
go
-----
sa
Returns the id for the user one is currently logged in as.
select suser_name("153")
go
-----
login_name_x
Returns the login name (login_name_x) for the suid "153".
select suser_name("1145")
go
-----
NULL
Suid "1145" does not exist.
setuser,
sp_addalias,
sp_addgroup,
sp_addlogin,
sp_adduser,
sp_changegroup,
sp_configure "check password for digit",
sp_configure "minimum failed logins",
sp_configure "minimum password length",
sp_configure "systemwide password expiration",
sp_displaylogin,
sp_dropalias,
sp_dropgroup,
sp_droplogin,
sp_dropuser,
sp_helpgroup,
sp_helpuser,
sp_locklogin,
sp_modifylogin,
sp_password,
See also:
ASE T-SQL - Aggregate Functions, ASE T-SQL - User, mut_excl_roles(), proc_role(), role_contain(), role_id(), role_name(), show_role(), suser_id(), user, user_id(), user_name(), valid_name(), valid_user().
|