sp_who returns status information for specified Open Server threads.
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
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.
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.
The one “running” task is the thread that is executing sp_who.