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 “System functions”.
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.
SQL92 – Compliance level: Transact-SQL extension.
Any user can execute suser_id.
Functions suser_name, user_id