sp_who

Description

Reports information on current users and processes on Microsoft SQL Server.

NoteThis property is supported by ECDA Option for ODBC and ECDA Option for Oracle to Microsoft SQL data sources only.

Syntax

sp_who [ login_name | “spid” ]

Parameters

login_name

is the SQL Server login name for the user. If you provide a login name, sp_who reports information on processes being run by the specified user.

”spid”

is the number of a specific process. You must enclose it in quotes because a character-type argument is expected.

Usage

For each process being run, sp_who reports the server process ID, its status, the login name, the name of the host computer, the name of the database, and the command being run.

If no name is provided, sp_who reports on processes being run by all users.