SQL Server SESSION_USER Function

Posted by

SQL Server

SESSION_USER

Function

Example

Return the user name of the current user:

SELECT SESSION_USER;


Definition and Usage

The SESSION_USER function returns the name of the current user in the SQL Server database.

Syntax

SESSION_USER

Technical Details

Works in: SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data
Warehouse, Parallel Data Warehouse