SQL SERVER 2005 Delete Maintenance job Error: The DELETE statement conflicted with the REFERENCE constraint "Fk_subplan_jo

Source: Internet
Author: User

Here are some of the information found online to solve this problem:
Get this job_id first:

USE [msdb]GO/****** Object:  Job [dbbackup_diff.Subplan_1]    Script Date: 04/08/2015 10:22:46 ******/@job_id=N‘588acfb8-630b-41c3-aa47-90d3671bda90‘@delete_unused_schedule=1GO

According to job_id to subplan_id:

select subplan_id FROM msdb.dbo.sysmaintplan_subplans where job_id=‘588acfb8-630b-41c3-aa47-90d3671bda90‘subplan_idFE56B397-4704-4AA7-BE49-767C1574E7D0

Remove subplan_id from system tables Msdb.dbo.sysmaintplan_log and Msdb.dbo.sysmaintplan_subplans respectively as ' Fe56b397-4704-4aa7-be49-767c1574e7d0 ' 's record:

delete from msdb.dbo.sysmaintplan_log where subplan_id=‘FE56B397-4704-4AA7-BE49-767C1574E7D0‘
delete FROM msdb.dbo.sysmaintplan_subplans WHERE SUBPLAN_ID=‘FE56B397-4704-4AA7-BE49-767C1574E7D0‘

Back to the graphical interface and then delete the job will not be an error.

Reference:
Http://www.cnblogs.com/kerrycode/p/3852231.html

SQL SERVER 2005 Delete Maintenance job Error: The DELETE statement conflicted with the REFERENCE constraint "Fk_subplan_jo

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.