How to quickly delete sql agent jobs – via T-SQL

You can run the below to create a dynamic script that outputs the t-sql that you run to delete a bunch of SQL agent jobs. Another time saver in large environments.

select 'exec sp_delete_job @job_name =''' + name + ''''
from sysjobs
where name like '%your filter here%'
Rob StGeorge
Senior SQL Server Database Administrator residing in Auckland, NZ

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.