The T-SQL User_Name() Function 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