Just Code‎ > ‎

TSQL - Remove/Delete all SQL Server Agent jobs on your development server

posted Oct 4, 2011, 7:35 AM by Peter Henell   [ updated Jan 16, 2012, 2:12 PM ]
This is a snippet that is used to create a script that will delete all SQL Server Agent jobs on the server.

I do not recommend running this query unless you are very sure that it is a good idea.
SELECT 'exec msdb.dbo.sp_delete_job @job_id = ''' + CAST(job_id as VARCHAR(500)) + '''' FROM msdb.dbo.sysjobs;