Returns the server user’s ID number from the syslogins table.
suser_id([server_user_name])
is an Adaptive Server login name.
select suser_id()
------ 1
select suser_id("margaret")
------ 5
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.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute suser_id.
Documentation Transact-SQL Users Guide
Functions suser_name, user_id