sp_who

sp_who returns status information for specified Open Server threads.

Syntax

server_name... sp_who [loginame | “spid”]

Parameters

Examples

Usage

  • sp_who reports status information about a specified server thread or all current Open Server threads.

  • The output from sp_who matches the output from Adaptive Server sp_who.

  • sp_who returns a subset of the information that sp_ps returns.

  • loginame and spid are character string parameters. When using isql to execute sp_who as a remote procedure call from an Adaptive Server, surround the spid in quotes to avoid a syntax error.

  • If you do not specify loginame or spid, sp_who lists all current threads.

  • sp_who returns the following information:

    spid – the internal thread number of the thread.

    status – the current status of the thread. The values for this column are:
    • running

    • runnable

    • sleeping

    • sick

    • free

    • stopped

    • spawned

    • terminal

    • unknown

    The one “running” task is the thread that is executing sp_who.

Related reference
sp_ps
sp_terminate