CURRENT_USER statement in SQL Server
The CURRENT_USER statement returns the name of the current user in the SQL Server database.
Table of Contents
This article will show you in detail how to use the function to handle CURRENT_USER statements in SQL Server with specific syntax and examples to better visualize and capture functions.
Describe
The CURRENT_USER statement returns the name of the current user in the SQL Server database.
Syntax
To use the CURRENT_USER statement in SQL Server, we use the following syntax:
CURRENT_USER
- There are no parameters and arguments in the statement.
Note :
- Do not put parentheses () after CURRENT_USER function.
- See also USER_NAME, SESSION_USER and SYSTEM_USER functions.
- CURRENT_USER can be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005.
For example
See how to use the CURRENT_USER statement in SQL Server.
SELECT CURRENT_USER;
Result: 'quantrimang'
Previous article: COALESCE command in SQL Server
Next lesson: ISDATE function in SQL Server
4.5 ★ | 2 Vote
Read More
- CASE statement in SQL Server
- INSERT statement in SQL Server
- USER_NAME function in SQL Server
- ALTER TABLE statement in SQL Server
- COALESCE statement in SQL Server
- How to Write an Artist Statement
- DELETE command in SQL Server
- How to Write an Artist's Statement
- NULLIF function in SQL Server
- The difference between Truncate and Delete in Microsoft SQL Server
- ISNULL function in SQL Server
- The difference between web server and app server
- GROUP BY clause in SQL Server
- ISNUMERIC function in SQL Server