CURRENT_USER statement in SQL Server
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
You should read it
- USER_NAME function in SQL Server
- CURRENT_TIMESTAMP command in SQL Server
- Check the current user on Linux
- The CREATE USER command in SQL Server
- DROP USER command in SQL Server
- The command changes user in Windows
- How to Publish WEB Server, FTP Server and VPN Server via ADSL?
- NOW function - The function returns the current date and time in Excel
May be interested
- NULLIF function in SQL Serverthis article will show you in detail how to use the nullif function handler in sql server with specific syntax and examples to better visualize and capture functions.
- The difference between Truncate and Delete in Microsoft SQL Serverin the following article, we will help you distinguish some basic differences between two delete syntax and truncate table in microsoft sql server application. basically, both of these statements help us to remove the data, but in essence it is not so.
- ISNULL function in SQL Serverin sql server, the isnull function allows you to return an alternate value when an input expression is null.
- GROUP BY clause in SQL Serverthe group by clause in sql server (transact-sql) is used in the select statement to retrieve data from multiple records and result groups into 1 or more columns.
- ISNUMERIC function in SQL Serverthe isnumeric function in sql server checks whether the value of the passed expression is a valid numeric value, if there is isnumeric returns 1, otherwise it returns 0.
- The difference between web server and app serveryou have probably seen that the terms web server and app server are often used interchangeably as if they are related to the same thing and also facilitate the website to function properly. but in reality, they are not the same.
- JOIN in SQL Serverjoin is used to retrieve data from multiple tables, occurring when two or more tables are connected together in an sql statement.
- BREAK (Control Interrupt) command in SQL Serverthe break command used to exit the loop does not specify a stop condition or you want to stop the loop on condition that you specify and execute the statements following the loop statement end.
- CREATE TABLE command in SQL Serverin sql server (transact-sql), the create table statement is used to create and define tables.
- If ... Else in Cwhat is the if … else condition in c? what is the meaning and usage of if else statement in c? let's find out with tipsmake.com.com!