Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/10/d214220746/htdocs/thecrankydba/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 77

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/10/d214220746/htdocs/thecrankydba/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 87
Handy Script: Find Running SQL Agent Jobs | Mike Hillwig

Handy Script: Find Running SQL Agent Jobs

1

April 13, 2015 by Mike Hillwig

One of the things SQL Server doesn’t make all that easy is to know what SQL Agent jobs are running. At least that’s what I used to think.

After turning to multiple search engine queries, I was equipped with all kinds of complex scripts that parsed MSDB tables in all kinds of ways, but they never told me what I really wanted to know. What is running NOW. Then one day, I stumbled across this. I just wish I knew who had originally posted it so I could thank them.

exec msdb.dbo.sp_help_job @execution_status=1

This little thing tells me precisely which SQL Agent jobs are running at the moment, and that fills a great need in a lot of cases.

running_sql_agent_jobs

 

  • Dave

    When I saw the title of your post, I too was expecting a “complex script that parsed MSDB tables in all kinds of ways”… When I saw that single line of code, I laughed. Not out loud, mind you. But I still laughed. Less is more! Thanks for sharing.

    Dave