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. C++三大特性之封装

    原文地址:https://qunxinghu.github.io/2016/09/12/C++%20%E4%B8%89%E5%A4%A7%E7%89%B9%E6%80%A7%E4%B9%8B%E5%B ...

  2. javascript 调用cookies

    cookie   用来保存信息,并且与服务器互动,因此前端后端都可以使用cookie     值得一提的是:虽然cookie是以文件的形式存储在客户端的电脑上, 但浏览器只会让创建cookie的网站访 ...

  3. javaScript高级教程(三) javaScript不支持关联数组,只是语法上像关联数组

    1.在js中所有要素都是继承自Object对象的,任何对象都能通过obj['name'] = something的形式来添加属性,相当于obj.name=something. 之所以设计中括号这种存取 ...

  4. java获取屏幕密度

    方法1: float xdpi = getResources().getDisplayMetrics().widthPixels;float ydpi = getResources().getDisp ...

  5. Scala系统学习(二):Scala开发环境安装配置

    Scala可以安装在任何基于UNIX/Linux或基于Windows的系统上.在您的机器上开始安装Scala之前,必须在计算机上安装Java 1.8或更高版本. 下面请按照以下步骤安装Scala. 步 ...

  6. CentOS 6.5通过yum的方式安装MySql

    一.mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库,咱 ...

  7. 摄影EV值深入研究

    1. 什么是EV值 1.1. EV值定义 EV(Exposure Value),曝光值,是反应曝光量的一个值.当感光度为ISO 100.光圈值为F1.曝光时间为1秒时,定义曝光量为0.曝光量减少一档时 ...

  8. unittest之suite测试集(测试套件)

    suite 这个表示测试集,不要放在class内,否则会提示"没有这样的测试方法在类里面 ",我觉得它唯一的好处就是调试的时候可以单独调试某个class而已,我一般不用它,调试时可 ...

  9. Redis 十分钟快速入门

    本教程是一个快速入门教程,所以Redis的命令只是简单介绍了几个常用的,如果有其他需求请求官网查看API 使用. 1. Redis简介 Redis 是完全开源免费的,遵守BSD协议,是一个高性能的ke ...

  10. redis error It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING

    应用redis出现如下错误 It was not possible to connect to the redis server(s); to create a disconnected multip ...