SUSER_SNAME returns login identification name from a user's security identification number (SID).
SUSER_SNAME can be used as a DEFAULT constraint in either ALTER TABLE or CREATE TABLE.
Syntax of SUSER_SNAME Function :
SUSER_SNAME ( [ 'server_user_sid' ] )
server_user_sid is a user's security identification number. It is of type varbinary(85). It is an optional. If you don't specify then it returns information about current user.
Return type of SUSER_SNAME is a nvarchar(256).
Examples of SUSER_SNAME Function :
Example 1 : Use of SUSER_SNAME function in select clause
SELECT SUSER_SNAME (0x0105000000000005150000007D3F02A2B97927CFBCECB55FE8030000)
Output
NorthwindUser
Above example returns login name for specified user's security identification number.