How to use this situation for Query [Resolved]

Posted by Jayakumars under C# on 2/1/2017 | Points: 10 | Views : 1559 | Status : [Member] [MVP] | Replies : 1
hi

When i deleted jobs i meet this issue. How to Drop this Relationship this

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. (Microsoft SQL Server, Error: 547)

Mark as Answer if its helpful to you

Kumaraspcode2009@gmail.com



Responses

Posted by: Rajnilari2015 on: 2/2/2017 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
@Jayakumars Sir,
You need to delete the subplan

e.g.

USE [MSDB]
go

--Delete the Log history for the maintenance plan
DELETE FROM sysmaintplan_log
WHERE subplan_id in
( SELECT Subplan_ID from sysmaintplan_subplans

WHERE subplan_name = <SubPlanName> )

-- Delete the subplan
DELETE FROM sysmaintplan_subplans
WHERE subplan_name = <SubPlanName>



For more information please refer: http://dba.stackexchange.com/questions/121877/sql-server-cannot-drop-idle-job/121883

hope this helps

--
Thanks & Regards,
RNA Team

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response