Functions That Return Usernames and User IDs

Several system functions return usernames and user IDs. Understanding the parameters and output of these functions requires understanding the types of names and IDs used in Microsoft® SQL Server™.

Each user logging in to SQL Server has two levels of names in SQL Server, and each name is associated with a unique ID:

For more information about login and database user accounts, see Logins, Users, Roles, and Groups.

Getting Login Accounts or IDs

When you are connected to SQL Server 7.0, use:

In SQL Server 7.0, the functions that return login names or accounts operate in this manner:

Getting Database Usernames or User IDs

When you are connected to SQL Server 7.0, use:

In SQL Server 7.0, the functions that return login names or accounts operate in this manner:

See Also
CURRENT_USER SYSTEM_USER
SUSER_ID USER_ID
SUSER_SID USER_NAME
SUSER_SNAME  

  


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