Retrieve the username of the current user in the SQL Server database.
SELECT CURRENT_USER; |
The CURRENT_USER function retrieves the name of the current user within the SQL Server database.
CURRENT_USER |
Works in: |
SQL Server (from 2008 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse |