Reporting on users and processes

Use sp_who to report information about current users and processes on Adaptive Server:

sp_who [loginame | "spid"]

where:

For each process run, sp_who reports the security-relevant information for the server process ID, its status, the login name of the process user, the real login name (if login_name is an alias), the name of the host computer, the server process ID of a process that is blocking this one (if any), the name of the database, and the command being run.

If you do not provide a login name or spid, sp_who reports on processes being run by all users.

The following example shows the security-relevant results from executing sp_who without a parameter:

fid spid  status      loginame   origname   hostname          blk_spid  dbname
   tempdbname  cmd               block_xloid    threadpool
--- ----  ---------   ---------  ---------  ---------------   --------  -----------
   ----------- ----------------- -----------    -----------------
  0    1    running         sa         sa            sunbird         0        pubs2
        tempdb  SELECT                     0     syb_default_pool
  0    2   sleeping        NULL       NULL                           0       master
        tempdb  NETWORK HANDLER            0     syb_default_pool
  0    3   sleeping        NULL       NULL                           0       master
        tempdb  MIRROR HANDLER             0     syb_default_pool
  0    4   sleeping        NULL       NULL                           0       master
        tempdb  AUDIT PROCESS              0     syb_default_pool
  0    5   sleeping        NULL       NULL                           0       master
        tempdb  CHECKPOINT SLEEP           0     syb_default_pool

sp_who reports NULL for the loginame for all system processes.