use msdb go declare @sqlnvarchar(4000) set @sql='' whileexists(select top 11from dbo.sysjobs where enabled=1) begin select top 1 @sql='EXEC dbo.sp_update_job @job_name = N'''+name+''',@enabled = 0;'from dbo.sysjobs where enabled=1 --print @sql exec(@sql) end