SUSER_ID function [System]

Returns the numeric user ID for the specified user name.

Syntax
SUSER_ID( [ user-name ] )
Parameters
  • user-name   The user name for the user ID you are searching for.

Returns

INT

Remarks

If you do not specify user-name, the ID of the current user is returned.

See also
Standards and compatibility
  • SQL/2003   Transact-SQL extension.

Example

The following statement returns the ID for the GROUPO user.

SELECT SUSER_ID( 'GROUPO' );