sp_who (version 6.5)

Provides information about current SQL Server users and processes. The information returned can be filtered to return only those processes that are not idle.

For additional syntax information for sp_who, see the Microsoft SQL Server Transact-SQL Reference.

Syntax

sp_who [login_name | 'spid' | active]

where

active
Returns information on active processes. Specifying active will exclude idle processes from the report. Idle processes are sleeping and are not involved in blocking.

For more information about blocking, see the Microsoft SQL Server Administrator's Companion.

Remarks

This procedure reports information about a specific user, a specified SQL Server process, all users currently running a process, or all active processes. Executing sp_who without parameters reports which users are running what processes in all databases.

Example

A.    Display All Active Processes
sp_who active
  
B.    Display a Specific Process with Process ID
sp_who '10' --specifies the process_id
  

Permission

Execute permission defaults to the public group.