Monday, May 27, 2013

delete orphaned sql jobs


--select * from sys.master_files order by physical_name

select * from dbo.sysjobs
select * from dbo.sysmaintplan_subplans

delete from dbo.sysmaintplan_subplans where subplan_id='7659F4CD-F98D-4F28-9372-5DBDC0BE168D'

delete from dbo.sysmaintplan_log where subplan_id='7659F4CD-F98D-4F28-9372-5DBDC0BE168D'

--sp_help sysmaintplan_subplans

delete from sysjobs where job_id='B3FECCA3-A0D2-4BEA-88D6-685EBE2F1164'

No comments: