can't drop sql job

I ma unable to delete an SQL maintenance job (SQL 2005). Error is 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. (.Net SqlClient Data Provider)
Who is Participating?
k_murli_krishnaConnect With a Mentor Commented:
use msdb
select * from sysmaintplan_subplans
delete from sysmaintplan_subplans
where subplan_name = 'Subplan_1' -- 'Subplan_1' let us say is the name of the subplan which is the culprit here.

For other solutions, refer:

Cannot Delete Job
Can't delete a Maintenance Plan scheduled job
Alfred A.Commented:

My suggestion is for you to drop the constraint "FK_subplan_job_id" first before you delete the job.
ITeedOffAuthor Commented:
I do not understand the use msdb. Where do I access this?
All Courses

From novice to tech pro — start learning today.