Adam
Adam

Reputation:

Meaning of sp_who Status in SQL Server

Can someone tell me what the statuses mean in SQL Server's sp_who command? Why might a spid be suspended? What does it mean to be "runnable"?

Thanks!

Upvotes: 16

Views: 17162

Answers (2)

Craig
Craig

Reputation: 36836

Pretty easy to find answer online. Link

  • dormant. SQL Server is resetting the session.
  • running. The session is running one or more batches. When Multiple Active Result Sets (MARS) is enabled, a session can run multiple batches. For more information, see Using Multiple Active Result Sets (MARS).
  • background. The session is running a background task, such as deadlock detection.
  • rollback. The session has a transaction rollback in process.
  • pending. The session is waiting for a worker thread to become available.
  • runnable. The session's task is in the runnable queue of a scheduler while waiting to get a time quantum.
  • spinloop. The session's task is waiting for a spinlock to become free.
  • suspended. The session is waiting for an event, such as I/O, to complete.

Upvotes: 30

PseudoToad
PseudoToad

Reputation: 1574

I believe that part of the confusion on this is that there are statuses outside of the list shown above that are seen. Three that come to mind are

  • Sleeping
  • Awaiting Command
  • Other

Upvotes: 1

Related Questions