bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server USER_NAME() Function

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind SQL Server USER_NAME() Function?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___ USER_NAME();
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The USER_NAME() function returns the database user name based on the specified id.
Definition and Usage
SQL Server USER_NAME() Function

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

ParameterDescription
id_numberOptional. 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

Previous

SQL Server SYSTEM_USER Function

Next

MS Access Functions