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, 但是没有被删除.尝试 ...
随机推荐
- find a way to escape--hdu1593
题目链接 : http://acm.hdu.edu.cn/showproblem.php?pid=1593 找到二者角速度相等时水中人的R,在此之前二者保持在一条直线上,之后水中的人沿直线到岸边S点匀 ...
- zookeeper 版本不一致导致不断重连
在使用kafka 和zookeeper 实现实时分析程序时,由于zookeeper部署版本和分析程序导入jar包的版本不一致,导致了当实时分析程序从远程服务器连接kafka集群的zookeeper时报 ...
- html_parser
import json from lxml import etree class HtmlParser(object): """这是HtmlParser"&qu ...
- 梯度下降算法(Gradient Descent)
近期在搞论文,须要用梯度下降算法求解,所以又一次整理分享在这里. 主要包含梯度介绍.公式求导.学习速率选择.代码实现. 梯度下降的性质: 1.求得的解和选取的初始点有关 2.能够保证找到局部最优解,由 ...
- UIImage添加滤镜
UIImage *image =[UIImage imageNamed:"]; NSArray *arr = [NSArray arrayWithObjects:@"CISRGBT ...
- 启动rabbitmq,提示ERROR: node with name "rabbit" already running on "localhost"
➜ ~ rabbitmq-server ERROR: node with name "rabbit" already running on "localhost" ...
- [py][mx]django分页第三方模块django-pure-pagination
前台的这些数据都是从后台取来的 分页模块django-pure-pagination - 一款基于django pagination封装的更好用的分页模块 https://github.com/jam ...
- HTML <input> 标签的 name 属性
定义和用法 name 属性规定 input 元素的名称. name 属性用于对提交到服务器后的表单数据进行标识,或者在客户端通过 JavaScript 引用表单数据. 注释:只有设置了 name 属性 ...
- soapUI-DataGen
1.1.1 DataGen 1.1.1.1 概述 – DataGen DataGen TestStep可用于生成要用作TestCases中的输入的数据,例如数字或日期序列,随机选择等.生成的数据可作 ...
- [LeetCode] 112. Path Sum_Easy tag: DFS
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all ...