suser_id

Returns the server user’s ID number from the syslogins table.

Syntax

suser_id([server_user_name])

Parameters

Examples

Usage

  • suser_id, a system function, returns the server user’s ID number from syslogins. For general information about system functions, see Transact-SQL Users Guide.

  • To find the user’s ID in a specific database from the sysusers table, use the user_id system function.

  • If no server_user_name is supplied, suser_id returns the server ID of the current user.

See also Transact-SQL Users Guide.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute suser_id.

Related reference
suser_name
user_id