Skip to content

USER_NAME

SELECT USER_NAME();
dbo

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.