SUSER_ID (T-SQL)

Returns the user’s login identification number. The SUSER_ID system function is included in Microsoft® SQL Server™ version 7.0 for backward compatibility. Use SUSER_SID instead.

Syntax

SUSER_ID(['login'])

Arguments
'login'
Is the user’s login identification name. login, which is optional, is nchar. If login is specified as char, it is implicitly converted to nchar. login can be any SQL Server login or Microsoft Windows NT® user or group that has permission to connect to SQL Server. If login is not specified, the login identification number for the current user is returned.
Return Types

int

Remarks

In SQL Server 7.0, the security identification number (SID) replaces the server user identification number (SUID).

SUSER_SID returns a SUID only for a login that has an entry in the syslogins system table.

System functions can be used in the select list, in the WHERE clause, and anywhere an expression is allowed, and must always be followed by parentheses (even if no parameter is specified).

Examples

This example returns the login identification number for the sa login.

SELECT SUSER_ID('sa')

  

See Also
Managing Security System Functions

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.