Accessing and Changing Relational Data

Functions That Return User Names and User IDs

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

Each user logging on 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 connected to SQL Server 2000, use:

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

Getting Database User Names or User IDs

When connected to SQL Server 2000, use:

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

See Also

CURRENT_USER

SYSTEM_USER

USER_ID

SUSER_SID

USER_NAME

SUSER_SNAME