SUSER_NAME()
SUSER_NAME returns the login identification name of the user.
Signature
SUSER_NAME ( [ server_user_id ] )Parameters
- server_user_id — The login identification number of the user. *server_user_id*, which is optional, is int. *server_user_id* can be the login identification number of any SQL Server login or Windows user or group that has permission to connect to an instance of SQL Server. When *server_user_id* isn't specified, the login identification name for the current user is returned. If the parameter contains the word `NULL`, it returns `NULL`.
Examples
SELECT SUSER_NAME(1);saRun against SQL Server 16.0.4265.3 on 2026-09-13. This is the output we got, not the documentation’s.
Available on
- SQL Server 2017 and later
- Azure SQL Managed Instance
- Azure Synapse Analytics
- Microsoft Fabric warehouse
Signature and description adapted from the Microsoft SQL documentation, used under the CC BY 4.0. SQL Server and Azure are trademarks of the Microsoft group of companies. This page is not affiliated with Microsoft.