无法删除Maintainplan Job 错误547

无法删除Maintainplan Job 错误547,第1张

概述今天删除SQLServer维护计划的时候出现下面的错误:   The DELETE statement conflicted with the REFERENCE constraint "FK_subplan_job_id". The conflict occurred in database "msdb", table "dbo.sysmaintplan_subplans". (Microsft

今天删除sqlServer维护计划的时候出现下面的错误:

 

The DELETE statement conflicted with the REFERENCE constraint "FK_subplan_job_ID". The conflict occurred in database "msdb",table "dbo.sysmaintplan_subplans". (Microsft sql Server,Error:547)

 

 

解决办法:

 

Use MSDB

go

delete from sysmaintplan_subplanswherejob_IDin

( select job_IDfromsysjobswhere namelike'%MaintenancePlan.Subplan_1%')

 

执行成功后在Management studio中可以正常删除维护计划Job

 

如果上面的语句无法成功,提示“tablesysmaintplan_log,可以先执行下面的语句然后在删除sysmaintplan_subplans记录。

 

deletesysmaintplan_log

  fromsysmaintplan_subplans as subplans INNER JOIN

    sysjobs_vIEwas syjobsonsubplans.job_ID=syjobs.job_IDINNERJOIN

    sysmaintplan_log onsubplans.subplan_ID=sysmaintplan_log.subplan_ID

  where (syjobs.name= @jobname);

总结

以上是内存溢出为你收集整理的无法删除Maintainplan Job 错误547全部内容,希望文章能够帮你解决无法删除Maintainplan Job 错误547所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/1177745.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存