USER_NAME() Security Function TSQL Tutorial

Is part of security functions and return the user name of database.

USER_NAME() Syntax:

USER_NAME()

USER_NAME() Example:

select USER_NAME() as 'User_name';

User_name
test

See also: T-SQL Functions -> CURRENT_USER | ORIGINAL_LOGIN | SESSION_USER | SYSTEM_USER