Returns the user’s login identification number. The SUSER_ID system function is included in Microsoft® SQL Server™ version 7.0 for backward compatibility. Use SUSER_SID instead.
SUSER_ID(['login'])
int
In SQL Server 7.0, the security identification number (SID) replaces the server user identification number (SUID).
SUSER_SID returns a SUID only for a login that has an entry in the syslogins system table.
System functions can be used in the select list, in the WHERE clause, and anywhere an expression is allowed, and must always be followed by parentheses (even if no parameter is specified).
This example returns the login identification number for the sa login.
SELECT SUSER_ID('sa')
Managing Security | System Functions |