Microsoft Certified IT Professional Rudi Bruchez EI Microsoft Certified IT Professional

Rudi Bruchez EI · www.pachadata.com · rudi@pachadata.com · +33 6 22 48 76 99
Consulting, audit, performance tuning, solutions, training
SQL Server OLTP and BI / NoSQL

Version of October 14, 2026 (05bbe79b) · https://www.pachadata.com/en/docs/howtos/troubleshooting/sp-whoisactive/

Use sp_whoisactive to see the active queries

Useful sp_whoisactive parameters to see the queries running now: execution plans, blocking chain leaders, memory grant information, average duration.

sp_whoisactive is Adam Machanic’s stored procedure. It shows what is running on an instance right now, in a far more readable form than sp_who2.

Useful parameters

  • @get_plans — tinyint, 0 by default. Set to 1 to include the plan of the running statement in the output, or to 2 to get the entire plan of the batch or procedure.
  • @find_block_leaders — bit, 0 by default. Set to 1 to identify the sessions at the head of a blocking chain, and the number of sessions each one blocks.
  • @get_memory_info — exposes the memory grant information for the query.
  • @get_avg_time — bit, 0 by default. Set to 1 to add the average duration of past runs of the active query, read from sys.dm_exec_query_stats.

Contact

I have been an independent SQL Server consultant since 2006. I help when an application slows down, when a server costs too much in storage or licenses, or when a migration must not stop production: audit and diagnosis, query and index tuning, migrations, high availability, training. On site, or as a remote audit delivered in five working days.

rudi@pachadata.com · +33 6 22 48 76 99 · www.pachadata.com/en/contact/