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.PageID
FROM dbo.tbx_pag_Page AS a
INNER JOIN dbo.tbx_mod_Module AS b ON a.ModuleID = b.ModuleID
WHERE b.PhysicalModuleID IN ( 16, 19 )
AND a.PageID = c.PageID );
The DELETE statement conflicted with the REFERENCE constraint的更多相关文章
- SQL SERVER 2005删除维护作业报错:The DELETE statement conflicted with the REFERENCE constraint "FK_subplan_job_id"
案例环境: 数据库版本: Microsoft SQL Server 2005 (Microsoft SQL Server 2005 - 9.00.5000.00 (X64) ) 案例介绍: 对一个数据 ...
- Store update, insert, or delete statement affected an unexpected number of rows ({0}).
问题描述 Store update, insert, or delete statement affected an unexpected number of rows ({0}). Entities ...
- system.Data.Entity.Infrastructure.DbUpdateConcurrencyException: Store update, insert, or delete statement affected an unexpected number of rows (0) 问题
页面控件没有做限制.提交后还可以继续点击,造成了在短时间内的多次请求.查看日志两次错误在200ms之内. 错误信息 system.Data.Entity.Infrastructure.DbUpdate ...
- using the library to generate a dynamic SELECT or DELETE statement mysqlbaits xml配置文件 与 sql构造器 对比
https://github.com/mybatis/mybatis-dynamic-sql MyBatis Dynamic SQL What Is This? This library is ...
- Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded.
EF6进行Insert操作的时候提示错误 Store update, insert, or delete statement affected an unexpected number of rows ...
- 跨年夜问题:一句并不复杂的delete竟然在delete statement处cost飙升,在数据量上升的十万级就像进入了死循环,执行后久久没有结果
笔者使用的环境: # 类别 版本 1 操作系统 Win10 2 数据库 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bi ...
- Linux: How to delete a disk or LUN reference from /dev
In AIX, there is rmdev command to remove a disk/LUN from /dev directory i.e to make the disk/LUN una ...
- SQL Sever 博客文章目录(2016-07-06更新)
SQL Server方面的博客文章也陆陆续续的写了不少了,顺便也将这些知识点整理.归纳一下下.方便自己和他人查看. MS SQL 数据类型 三大数据库对比研究系列--数据类型 MS SQL 表和视图 ...
- 删除Management Data Warehouse (MDW) job失败
转:http://lzf328.blog.51cto.com/1196996/1349670 最近在清理一些不用的Job,发现几个跟MDW有关的.虽然Job已经被Disable, 但是没有被删除.尝试 ...
随机推荐
- The Unique MST----poj1679次小生成树
题目链接:http://poj.org/problem?id=1679 判断最小生成数是否唯一:如果唯一这权值和次小生成树不同,否则相同: #include<stdio.h> #inclu ...
- hive-site.xml配置
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-s ...
- 格式化NameNode
$cd /app/hadoop/hadoop-2.2.0/ $./bin/hdfs namenode -format
- Window版本 安装mysql
#1.下载:MySQL Community Server 5.7.16 http://dev.mysql.com/downloads/mysql/ 下载下来解压到指定目录 就安装完成了 #2.解压 如 ...
- [vue]spa单页开发及vue-router基础
- 了解spa页面跳转方式:(2种) spa: 单页跳转方式 开发(hash模式): https://www.baidu.com/#2313213 生产(h5利于seo): history.pushS ...
- python3内置函数大全(顺序排列)
python3内置函数大全 内置函数 (1)abs(), 绝对值或复数的模 1 print(abs(-6))#>>>>6 (2)all() 接受一个迭代器,如果迭代器的所有 ...
- Keras 源码分析
. │ activations.py │ callbacks.py │ constraints.py │ initializations.py │ metrics.py │ models.py │ o ...
- HTML 显示/隐藏DIV的技巧(visibility与display的差别)
参考链接:http://blog.csdn.net/szwangdf/article/details/1548807 div的visibility可以控制div的显示和隐藏,但是隐藏后页面显示空白: ...
- Twitter OA prepare: K-complementary pair
2sum的夹逼算法,需要sort一下.本身不难,但是tricky的地方在于允许同一个数组元素自己跟自己组成一个pair,比如上例中的[5, 5].而且数组本身就允许值相等的元素存在,在计算pair时, ...
- Leetcode: Merge k Sorted List
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 参 ...