T-SQL – Checking Users and Processes Details

T-SQL – Checking Users and Processes Details

If you want to check quickly what all processes are being run or which user is running what process, what is the cause of blocked processes and etc., and then sp_who or sp_who2 commands are very helpful.

sp_who provides below details:

  • System process ID.
  • Status of the process.
  • Login name of the user.
  • Name of the user.
  • If the process is blocked, the SPID of the blocking process.
  • Database the process is using.
  • Command currently being executed.

sp_who


sp_who2 provides additional information like:

  • Total CPU time of each process.
  • Total amount of disk reads for each process.
  • Last time a client called a procedure or executed a query.
  • Application connected.

sp_who2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s