EXEC dbo.sp_delete_schedule @schedule_name = N’NightlyJobs’ ; –删除指定作业
–作业相关的数据库表
use msdb
select * from msdb.dbo.sysmaintplan_plans –查看作业ID
delete from msdb.dbo.sysmaintplan_log where plan_id =作业ID
delete from msdb.dbo.sysmaintplan_subplans where plan_id =作业ID
DELETE FROM msdb.dbo.sysmaintplan_plans WHERE [ID]=作业ID