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)
ITeedOffAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Hi,

My suggestion is for you to drop the constraint "FK_subplan_job_id" first before you delete the job.
0
k_murli_krishnaCommented:
use msdb
go
 
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
http://www.sqlservercentral.com/Forums/Topic341284-149-1.aspx#bm341298
Can't delete a Maintenance Plan scheduled job
https://connect.microsoft.com/SQLServer/feedback/details/255226/cant-delete-a-maintenance-plan-scheduled-job
http://dbaspot.com/forums/ms-sqlserver/148756-cannot-delete-maintenance-plan.html
http://www.developmentnow.com/g/118_2006_10_0_0_831628/Cannot-Delete-Maintenance-Plans--SQL-2005.htm
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ITeedOffAuthor Commented:
I do not understand the use msdb. Where do I access this?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.