user

Returns the name of the current user.

Syntax

user

Examples

Usage

If the sa_role is active, you are automatically the database owner in any database you are using. Inside a database, the user name of the database owner is always “dbo”.

See also Transact-SQL Users Guide.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute user.

Related reference
user_name