Tuesday, March 20, 2012

Cannot delete maintenance plan.

Cannot delete a maintenance plan. SQL 2005 patched service pack 2. (That
means I was dumb enough to apply service pack 2 immediately and then
microsoft release a patch a couple days later because spk2 was broken)
The DELETE statement conflicted with the REFERENCE constraint
"FK_subplan_job_id". The conflict occurred in database "msdb", table
"dbo.sysmaintplan_subplans", column...Apparently the job you try to delete has one or more subplans that (for some
reason) should be deleted apart.
Try deleting the single subplans before deleting the Maintenance Plan itself
.
Each Subplan has foreign keys referencing the sysjobs table, containing the
definition of the Plan.
I cannot define the exact cause of your issue because i don't know the
complete history of the plan, his subplans, the schedules etc.
Look in msdb at the system tables to undertand the relationships between the
various table but DON'T TRY to operate updates directly over them!
Gilberto Zampatti
"SQLdba" wrote:

> Cannot delete a maintenance plan. SQL 2005 patched service pack 2. (That
> means I was dumb enough to apply service pack 2 immediately and then
> microsoft release a patch a couple days later because spk2 was broken)
> The DELETE statement conflicted with the REFERENCE constraint
> "FK_subplan_job_id". The conflict occurred in database "msdb", table
> "dbo.sysmaintplan_subplans", column...
>
> --
>

No comments:

Post a Comment