USER_NAME
USER_NAME()
Section titled “USER_NAME()”Example
Section titled “Example”SELECT USER_NAME();Output
Section titled “Output”dboExplanation
Section titled “Explanation”The USER_NAME() function in SQL Server returns the database user name based on the specified user ID. If the user ID is not specified, the function will return the name of the current user. In this case, the output ‘dbo’ represents the database owner.