Latest Code of WhatIsRunning Script
I have created this TSQL Query that provide almost all information regarding running queries. This code gives query at Batch Level and at individual TSQL query within that Batch. Incase the running session is SQL Agent job, then [Program_Name] column data would be shown like 'SQL Job = < job name >'. Below is sample screenshot.
Latest Code of Modified [sp_WhoIsActive] Script
I am big fan of Adam Mechanic's [sp_WhoIsActive]. I have modified the latest script v11.30
to provide the job name
in case the running session belongs to sql agent job. Below are sample screenshots.