THE WORLD'S LARGEST WEB DEVELOPER SITE

SQL Server SESSION_USER Function

❮ SQL Server Functions

Example

Return the user name of the current session in the SQL Server database:

SELECT SESSION_USER;
Try it Yourself »

Definition and Usage

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

Syntax

SESSION_USER

Technical Details

Works in: SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005

❮ SQL Server Functions