OK...from the msdn forums others were having the same problem.
Because there was a foreign key constraint on the sysmaintplan_log. I
deleted the item with the constraint in the sysmaintplan_log table.
delete from dbo.sysmaintplan_log where plan_id = 'my_plan_id '
Then ran:
EXECUTE sp_delete_maintenance_plan 'my_plan_id '
and that did the trick.
Thank you!
[quoted text, click to view] "RandyH" <RHollaw@HOTmail.com> wrote in message
news:5C7E4635-2999-4531-85DC-A26D3165BAC7@microsoft.com...
> For the life of me, I can't delete a backup job that was created with the
> maintenance wizard.
>
> The job deletes from the Management\Maintenance tree, but doesn't delete
> from the SQL Server Agent tree.
>
> I script the job to drop and get this error msg:
>
> Msg 547, Level 16, State 0, Procedure sp_delete_job, Line 170
> The DELETE statement conflicted with the REFERENCE constraint
> "FK_subplan_job_id". The conflict occurred in database "msdb", table
> "dbo.sysmaintplan_subplans", column 'job_id'.
> The statement has been terminated.
>
> I don't know what this means:
> The DELETE statement conflicted with the REFERENCE constraint
> "FK_subplan_job_id".
>
> In dbo.sysmaintplan_subplans I can see what the error is referring too,
> but it doesn't really lead me to anything else.
>
> And
>
> Why when you create a maintenance plan using the create maintenance plan
> wizard, does the SQL Agent add a "subplan" to the job?
>
> I hope someone can help me.
> Thank you,
> RandyH
>
>