The DELETE statement conflicted with the REFERENCE constraint
Page是主表,主键是pageid;UserGroupPage表中的PageID字段是Page表里的数据。
https://www.codeproject.com/Questions/677277/I-am-getting-error-while-delete-entry
You are trying to Delete the record from a Table which has a reference in another Table.
Here REFERENCE
constraint is "FK_User_History_Tbl_Customer
".
Tables are User_History
and Tbl_Customer
.
UserId
column is referenced by Tbl_Customer
Table.
When you try to delete a row from User_History
Table, it comes to know that the same row has some related row in Tbl_Customer
Table.
So, you need to delete from Tbl_Customer
Table first and then delete from Table User_History
.
If you want to delete a row, then you have to execute the following two queries in sequence.
DELETE FROM Tbl_Customer WHERE UserId = [[[UserIdToDelete]]];DELETE FROM User_History WHERE UserId = [[[UserIdToDelete]]]
尝试筛选了一下数据,居然有记录。本地的开发环境是没有记录的
SELECT * FROM dbo.tba_ugp_UserGroupPage AS c WHERE EXISTS ( SELECT a.PageIDFROM dbo.tbx_pag_Page AS aINNER JOIN dbo.tbx_mod_Module AS b ON a.ModuleID = b.ModuleIDWHERE b.PhysicalModuleID IN ( 16, 19 )AND a.PageID = c.PageID );
转载于:https://www.cnblogs.com/chucklu/p/10528825.html
The DELETE statement conflicted with the REFERENCE constraint相关推荐
- Msg 547 The ALTER TABLE statement conflicted with the CHECK constraint .
创建约束出现下面的错误: Msg 547, Level 16,State 0, Line 2 The ALTER TABLEstatement conflicted with the CHECK co ...
- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint FK_SortId.
在创建外键时,出错. USE E_Market GO ALTER TABLE CommodityInfo ADD CONSTRAINT FK_SortId FOREIGN KEY(SortId) re ...
- ‘The INSERT statement conflicted with the FOREIGN KEY constraint “FK_TourismReservation_Users“. The
问题描述 在写数据库插入操作的时候遇到这个报错问题 'The INSERT statement conflicted with the FOREIGN KEY constraint "FK_ ...
- error: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities
{"Store update, insert, or delete statement affected an unexpected number of rows (0). Entities ...
- EF migration conflicted with foreign key constraint
原因: 已存在的数据外键引用冲突 解决方法: 1.删除主表数据 2.如果是生产数据,不能删除,那么先将关联字段设置为Null,然后再migration
- ADO.NET Entity Framework 深入分析, Part 5
ADO.NET Entity Framework 深入分析, Part 5 前面的Part 1-4的文章,介绍了Entity Data Model.Entity SQL.ObjectQuery.Ent ...
- 组织架构递归_映射架构和递归管理数据–第1部分
组织架构递归 介绍 (Introduction) In a typical OLTP environment, we want to maintain an acceptable level of d ...
- 删除Management Data Warehouse (MDW) job失败
最近在清理一些不用的Job,发现几个跟MDW有关的.虽然Job已经被Disable, 但是没有被删除.尝试删除出现下面的错误: The DELETE statement conflicted with ...
- 如何从Confluence数据库手动删除陈旧草稿
如果您的Confluence数据库存储了大量过时草稿,则协作编辑可能需要很长时间甚至无法启用.查看下面的错误了解更多详情: CONFSERVER-55745 - 如果数据库 关闭时存在大量陈旧的草稿, ...
最新文章
- 如何配置Linux的时钟同步
- My SQL InnoDB 1217 - Cannot delete or update a parent row:aforeign key constraint fals
- 限定概率抽奖_圣诞节LOL紫色宝箱30连抽,限定全是冰雪,节日气氛很浓
- Web开发的那点事--业务层常用功能
- 取消堆集以提高延迟并减少AWS账单
- html5录音功能代码,recorder.js 基于 HTML5 实现录音功能
- iOS 两种不同的图片无限轮播
- 收集DC中失败的登录信息并邮件通知
- 【交通预测】基于matlab GUI交通预测四阶段法交通分配【含Matlab源码 1140期】
- php生成一个500错误_Hyperf 发布 v2.0.1 版本 | 企业级的 PHP 微服务云原生协程框架...
- GO及其LiteIDE踩坑
- 2022年计算机软件水平考试网络管理员(初级)练习题及答案
- 谷歌地图、百度地图、搜搜地图之浅比较
- python批量查询ip归属地_python查询ip归属地
- 头条极速版问答自动化教程
- js调用网页打印接口
- Tesla_T4加速卡详细参数
- Linux 线程基础 1
- 洛谷P3853 [TJOI2007]路标设置
- 一辈子是场修行 短的是旅行 长的是人生
热门文章
- I帧和IDR帧区别(转载)
- as的断点调试与高级断点调试
- SNARK性能及安全——Prover篇
- Java se官方中文API下载链接
- 获取手机唯一标识插件_H5能获取到手机设备ID或者手机浏览器唯一识别码吗
- 第一章 世界的物质性及其发展规律(辩证的唯物论、唯物的辩证法)
- vue报错:Not Found - GET https://registry.npmjs.org/- Not found
- 百度搜索结果的URL参数 搜索历史记录(rsv_sug)
- 在python是什么意思_Python a=b是什么意思?
- 网络请求框架 -- 理解Https