sp_who

Description

Return status information for specified Open Server threads.

Syntax

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

Parameters

loginame

The user’s login name.

spid

The internal identification number of the thread to report on. The spid can be obtained from the output of a previous sp_ps or sp_who call. If no spid is specified, all threads are listed.

Examples

Example 1

This example shows output from the sp_who procedure.

1>DCSERVER...sp_who 
 2>go
  spid    status     loginame     hostname   blk cmd               
 -------- ---------- ------------ ---------- --- ----------------
        1 runnable                           0   NETWORK HANDLER
        2 sleeping                           0   CONNECT HANDLER
        3 sleeping                           0   DEFERRED HANDLER
        4 runnable                           0   SCHEDULER
       11 sleeping                hiram      0
       14 running    bud          sonoma     0

In this example, the output columns are as follows:

loginame – the name of the logged in user. Applies only to client threads.

hostname – for a client task, this is the name of the client’s machine. For a site handler thread, it is the name of the remote Adaptive Server.

blk – this field is unused and is always set to 0.

cmd – a character string that describes the state of the thread. The contents of this column are set by the srv_thead_props routine.

Usage

Table 3-7 summarizes the results returned as rows with these columns:

Table 3-7: Format of information returned (sp_who)

Column name

Datatype

Length

spid

CS_INT_TYPE

4

status

CS_CHAR_TYPE

10

loginame

CS_CHAR_TYPE

12

hostname

CS_CHAR_TYPE

10

blk

CS_INT_TYPE

3

cmd

CS_CHAR_TYPE

16

See also

sp_ps, sp_terminate