In this post explains how to use the SESSION_USER function in SQL Server (Transact-SQL) with syntax and examples.
In SQL Server (Transact-SQL), the SESSION_USER function returns the user name of the current session in the SQL Server database.
The syntax for the SESSION_USER function in SQL Server (Transact-SQL) is:
Optional. The identification number associated with a user in SQL Server.
The SESSION_USER function can be used in the following versions of SQL Server (Transact-SQL):
Let's look at some SQL Server SESSION_USER function examples and explore how to use the SESSION_USER function in SQL Server (Transact-SQL).
For example: