无法删除Maintainplan Job 错误547
2012-08-21 17:19
260 查看
今天删除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);
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
- 错误14274:无法添加、更新或删除从msx服务器上发起的作业(或其步骤或调度)(转帖)
- SQL Server“错误14274: 无法添加、更新或删除从MSX服务器上发起的作业”的解决办法
- 无法删除登录名 '***',因为该用户当前正处于登录状态。 (Microsoft SQL Server,错误: 15434)
- 无法删除登录名 '***',因为该用户当前正处于登录状态。 (Microsoft SQL Server,错误: 15434)
- 有人问出现错误14274: 无法添加、更新或删除从MSX服务器上发起的作业
- 错误14274:无法添加、更新或删除从msx服务器上发起的作业(或其步骤或调度)
- Oracle 删除表空间错误 提示:ora-02429:无法删除用于强制唯一/主键的索引
- C++自定义类的析构函数,生成指针对象:用delete删除时,产生错误:"fatal error LNK1120: 1 个无法解析的外部命令"
- 用户无法顺利删除问题处理一则-ORA-00604和ORA-00942错误
- 错误: 15138删除对于用户失败,数据库主体在该数据库中拥有架构,无法删除。解决方法(转)
- Oracle下无法删除表(错误代码ORA-00604 ORA-01422)
- 错误14274:无法添加、更新或删除从msx服务器上发起的作业(或其步骤或调度)
- SQL Server“错误14274: 无法添加、更新或删除从MSX服务器上发起的作业”的解决办法
- 解决删除公司时出现“无法编辑##表中的记录”错误
- 错误14274:无法添加、更新或删除从MSX服务器上发起的
- 无法删除服务器 'old_server_name',因为该服务器用作复制过程中的发布服务器。 (Microsoft SQL Server,错误: 20582)
- SQL2005删除用户的时候,产生“数据库主体在该数据库中拥有架构,无法删除”错误的解决办法
- magento -- 开发模板时删除payment progress引起的错误导致用户无法下单
- SQL SERVER MaintanencePlan 失败 无法解密受保护的 XML 节点“DTS:Password”,错误为 0x8009000B解决