删除语句冲突 [英] delete statement conflicted

查看:100
本文介绍了删除语句冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮我删除一个表。





DELETE语句与REFERENCE约束FKOCHCN1冲突。

冲突发生在数据库samefrt,表dbo.OCHN。

解决方案

之间存在主键和外键之间的关系表,我猜你试图从主键表(父表)中删除记录,这是不正确的删除。首先你应该从外键表(子表)中删除记录,一旦从子目录中删除记录,那么只允许删除父表记录。








1-下降指数

DROP INDEX index_name



2 - 尝试从表中删除数据



3-重新创建INDEX


引用:

错误意味着您在其他表中有数据引用您要删除的数据。



您需要删除并重新创建约束或删除外键引用的数据。



source:我收到错误DELETE语句与REFERENCE约束冲突 [ ^ ]



有关详细信息,请参阅: SQL Server错误消息 - 消息547 [ ^ ]


please help me to delete a table.


The DELETE statement conflicted with with the REFERENCE constraint"FKOCHCN1". The
conflict occured in database"samefrt",table"dbo.OCHN".

解决方案

There is a Primary and foreign key relation between tables, I guess you are trying to delete record from Primary key table( parent table ), which is not correct to delete. First you should delete record from Foreign Key table( Child table), once record is deleted from child, then only it's allowing to delete parent table record.


Hi,


1- Drop INDEX
DROP INDEX index_name

2- Try to delete data from table

3- Recreate INDEX


Quote:

The error means that you have data in other tables that references the data you are trying to delete.

You would need to either drop and recreate the constraints or delete the data that the Foreign Key references.


source: I got error "The DELETE statement conflicted with the REFERENCE constraint"[^]

For further information, please see: SQL Server Error Messages - Msg 547[^]


这篇关于删除语句冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆