Use sp_whoisactive to see the active queries

Using sp_whoisactive to see the queries currently running.

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_planstinyint, 0 (default) or 1. Set to 1 to include the query plan in the output.
  • @find_block_leadersbit, 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_query_stats — exposes the query execution statistics.