T-SQL Tutorial

T-SQL SUSER_SID Security Function


The T-SQL SUSER_SID is an security function and returns the security identification number (SID) for the specified login name.


Syntax

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


SUSER_SID example

SELECT SUSER_SID();


SUSER_SID with a specific login

SELECT SUSER_SID('test_login');


SUSER_SID with a Windows user name

SELECT SUSER_SID('COMPUTER_NAME\windows_user_name');

See also: T-SQL Functions -> CURRENT_USER | ORIGINAL_LOGIN | SYSTEM_USER | USER_NAME