SUSER_SNAME#

Returns the login name associated with a security identification number (SID).

Syntax#

SUSER_SNAME ( [ server_user_sid ] )

Arguments#

server_user_sid

The optional login security identification number. server_user_sid is varbinary(85), and can be the security identification number of any Querona login or role. See SUSER_SID. If server_user_sid is not specified, information about the current user is returned. If the parameter contains NULL, or does not match a known login or Querona role, SUSER_SNAME returns NULL.

Return types#

nvarchar(128)

Examples#

SELECT SUSER_SNAME();
SELECT SUSER_SNAME(SUSER_SID('sa'));

See Also#