In this post, I am sharing one more script related to SQL Server Agent JOB.
In our reporting environment, one day I was facing performance issue. During my investigation, was found that one of the SQL Agent JOB was creating problems.
Because of JOB scheduling problems, one of the SHRINK database related JOB started in working hours which created performance issue.
If we have large system with lots of SQL Agent Jobs, The DBA is also very much responsible to keep an eye on all running SQL Server Agent Jobs.
Below T-SQL script, returns the information on all running SQL Agent Jobs.
FROM msdb.dbo.sysjobs AS SJ
INNER JOIN msdb.dbo.sysjobactivity AS SJA
ON SJ.job_id = SJA.job_id
WHERE SJA.run_requested_date IS NOT NULL
AND SJA.stop_execution_date IS NULL