Example
SELECT USER_NAME();Definition and Usage
The USER_NAME() function returns the database user name based on the specified id.
If no id is specified, this function will return the name of the current user.
Syntax
USER_NAME(
id_number
)Parameter Values
| Parameter | Description |
|---|---|
| id_number | Optional. The id number of a user in the database |
Technical Details
| Works in: | SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse |
|---|