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.

Hide   Copy Code
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的更多相关文章

  1. 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) ) 案例介绍: 对一个数据 ...

  2. 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 ...

  3. system.Data.Entity.Infrastructure.DbUpdateConcurrencyException: Store update, insert, or delete statement affected an unexpected number of rows (0) 问题

    页面控件没有做限制.提交后还可以继续点击,造成了在短时间内的多次请求.查看日志两次错误在200ms之内. 错误信息 system.Data.Entity.Infrastructure.DbUpdate ...

  4. 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 ...

  5. 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 ...

  6. 跨年夜问题:一句并不复杂的delete竟然在delete statement处cost飙升,在数据量上升的十万级就像进入了死循环,执行后久久没有结果

    笔者使用的环境: # 类别 版本 1 操作系统 Win10 2 数据库 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bi ...

  7. 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 ...

  8. SQL Sever 博客文章目录(2016-07-06更新)

    SQL Server方面的博客文章也陆陆续续的写了不少了,顺便也将这些知识点整理.归纳一下下.方便自己和他人查看. MS SQL 数据类型 三大数据库对比研究系列--数据类型 MS SQL 表和视图 ...

  9. 删除Management Data Warehouse (MDW) job失败

    转:http://lzf328.blog.51cto.com/1196996/1349670 最近在清理一些不用的Job,发现几个跟MDW有关的.虽然Job已经被Disable, 但是没有被删除.尝试 ...

随机推荐

  1. HDU5033 building 单调栈+计算几何

    正解:单调栈 解题报告: 哇生气辽QAQ本来打了半天feel good都快调出来了然后说换题了QAQ(所以可能那题的代码会过一阵子再放上来了QAQ 不过还是大爆手速打了一通拿到首杀了嘻嘻 美滋滋辽 然 ...

  2. Django单元测试简单示例

    对一个功能的验证往往是需要很多多测试用例,可以把测试用例集合在一起执行,这就产生了测试套件TestSuite 的概念,它是用来组装单个测试用例,规定用例的执行的顺序,而且TestSuite也可以嵌套T ...

  3. 梯度下降算法(Gradient Descent)

    近期在搞论文,须要用梯度下降算法求解,所以又一次整理分享在这里. 主要包含梯度介绍.公式求导.学习速率选择.代码实现. 梯度下降的性质: 1.求得的解和选取的初始点有关 2.能够保证找到局部最优解,由 ...

  4. InnoDB: Operating system error number 87 in a file operation. 错误87的解决方法

    InnoDB: Operating system error number 87 in a file operation. 错误87的解决方法 140628  8:10:48 [Note] Plugi ...

  5. Gcc ------ gcc的使用简介与命令行参数说明

    gcc的使用简介与命令行参数说明 2011年06月19日 20:29:00 阅读数:10221 2011-06-19 wcdj 参考:<GNU gcc嵌入式系统开发 作者:董文军> (一) ...

  6. 深入理解Fabric环境搭建的详细过程(转)

    前面的准备工作我就不用多说了,也就是各种软件和开发环境的安装,安装好以后,我们git clone下来最新的代码,并切换到v1.0.0,并且下载好我们需要使用的docker镜像,也就是到步骤6,接下来我 ...

  7. JavaScrip总体

    js: 简单对象: 数字 | 字符串 | 这三个像对象,有方法,但不可变 布尔值 | null undefined 对象:无类型,k-v对集合:函数.数组.REG.... JavaScript是一种l ...

  8. python接口自动化-参数化

    原文地址https://www.cnblogs.com/yoyoketang/p/6891710.html python接口自动化 -参数关联(一)https://www.cnblogs.com/11 ...

  9. jmeter 线程组之间的参数传递(加密接口测试三)

    场景测试中,一次登录后做多个接口的操作,然后登录后的uid需要关联传递给其他接口发送请求的时候使用. 1.在登录接口响应信息中提取uid字段值 1>login请求 -->添加 --> ...

  10. BinarySearch

    今天看代码,看到这么一段,开始没有看明白,记录下来备忘 foreach (FinancialReport r3 in addAorList)            {                i ...