SUSER_SID#

Returns the security identification number (SID) for the specified login name.

Syntax#

SUSER_SID ( [ 'login' ] [ , Param2 ] )

Arguments#

login

Is the login name of the user. login is sysname. login, which is optional, can be a SQL Server login or Windows user or group. If login is not specified, information about the current security context is returned. If the parameter contains NULL, SUSER_SID returns NULL. Login name matching is case-insensitive. If login does not match a known login or Querona role, SUSER_SID returns NULL.

Param2

Specifies whether the login name is validated. Param2 is int and is optional. Querona accepts Param2 for syntax compatibility but does not use its value.

Return types#

varbinary(85)

Examples#

SELECT SUSER_SID();
SELECT SUSER_SID('sa');
SELECT SUSER_SID('sa', 0);

See Also#