1、SET FOREIGN_KEY_CHECKS=0;

2、DELETE FROM ACT_RE_DEPLOYMENT where 1=1;

或者

truncate table ACT_RE_DEPLOYMENT ;

3、SET FOREIGN_KEY_CHECKS=1;

[Err] 1701 - Cannot truncate a table referenced in a foreign key constraint的更多相关文章

  1. django migrate报错:1005 - Can't create table xxx (errno: 150 "Foreign key constraint is incorrectly formed")

    自从mysql升级,以及使用mariaDB以来,很多不曾更新django中model的外键, 今天,按以前的思路写完外键之后, migrate命令报错: 1005 - Can't create tab ...

  2. Could not drop object 'student' because it is referenced by a FOREIGN KEY constraint

    1. Find foreign keys SELECT * FROM sys.foreign_keys WHERE referenced_object_id = object_id('Student' ...

  3. ORA-02266: unique/primary keys in table referenced by enabled foreign keys

    在数据库里面使用TRUNCATE命令截断一个表的数据时,遇到如下错误 SQL >TRUNCATE TABLE ESCMOWNER.SUBX_ITEM ORA-02266: unique/prim ...

  4. 关于mysql中[Err] 1451 -Cannot delete or update a parent row: a foreign key constraint fails

    mysql> SET FOREIGN_KEY_CHECKS = 0; Query OK, 0 rows affected (0.02 sec)   mysql> delete from r ...

  5. MySQL添加外键报错 - referencing column 'xx' and referenced column 'xx' in foreign key constraint 'xx' are incompatible

    MySQL给两个表添加外键时,报错 翻译意思是:外键约束“xx”中的引用列“xx”和引用列“xx”不兼容 说明两个表关联的列数据类型不一致,比如:varchar 与 int,或者 int无符号 与 i ...

  6. SQL Server 2008 R2——TRUNCATE TABLE 无法截断表 该表正由 FOREIGN KEY 约束引用

    =================================版权声明================================= 版权声明:原创文章 禁止转载  请通过右侧公告中的“联系邮 ...

  7. sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1091, "Can't DROP 'users_ibfk_1'; check that column/key exists") [SQL: ALTER TABLE users DROP FOREIGN KEY users_ibfk_1]

    flask 迁移数据库报错 报错: sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1091, "Can't DROP ...

  8. sqlserver truncate清空表时候,无法删除 'B表',因为该表正由一个 FOREIGN KEY 约束引用。

    外键: 查询:select object_name(a.parent_object_id) 'tables'  from sys.foreign_keys a  where a.referenced_ ...

  9. sql: Query to Display Foreign Key Relationships and Name of the Constraint for Each Table in Database

    --20170505 --塗聚文 Geovin Du CREATE DATABASE DuMailSystem GO USE DuMailSystem GO --1查詢表的及备注说明 SELECT S ...

随机推荐

  1. quick'n'dirty poc for CVE-2013-1763 SOCK_DIAG bug in kernel 3.3-3.8

    /* * quick'n'dirty poc for CVE-2013-1763 SOCK_DIAG bug in kernel 3.3-3.8 * bug found by Spender * po ...

  2. 【java】自定义排序

    使用Comparable接口 这里定义了一个类Node,有两个属性,id,age. 排序方法是,先根据id升序排,id一样,age降序排. 里面有一个compareTo方法.返回值有三个 1. < ...

  3. System.Web.Mvc 4.0.0.1 和 4.0.0.0 区别

    只是一个安全补丁的问题:  http://www.microsoft.com/zh-cn/download/details.aspx?id=44533&WT.mc_id=rss_alldown ...

  4. 2018-8-10-WPF-播放-gif

    title author date CreateTime categories WPF 播放 gif lindexi 2018-08-10 19:16:53 +0800 2018-2-13 17:23 ...

  5. Install ncurses (ncurses-devel) and try again

    apt install libncurses5-dev libncursesw5-dev

  6. vector注意事项

    vector注意事项: 如果你添加元素,但是vector的容量(是容量,不是大小,容量比大小大,会预先多分配空间)不够的话,系统就会重新分配一段内存,然后把原先的内容全部拷贝过去,然后删除原先的内容. ...

  7. leetcood学习笔记-20

    python字符串与列表的相互转换   学习内容: 1.字符串转列表 2.列表转字符串 1. 字符串转列表 str1 = "hi hello world" print(str1.s ...

  8. OpenSearch最新功能介绍

    摘要:阿里云开放搜索(OpenSearch)是一款结构化数据搜索托管服务,其能够提供简单.高效.稳定.低成本和可扩展的搜索解决方案.OpenSearch以平台服务化的形式,将专业搜索技术简单化.低门槛 ...

  9. NOIP模拟测试29(A)

    T1: 题目大意:有一张有向无环图,第$x$次经过边$i$的代价为$a_ix+b_i$,最多经过$c_i$次,起点为1,$s$个点可作为终点,求走$k$次的最小代价. 我们新建一个汇点,将所有可做为终 ...

  10. 栈+括号序列+暴力枚举——cf1248D1

    这个复杂度首先就想到是n3的复杂度,n2枚举换的位置,求值在花费n复杂度 判断一个序列有多少独立的括号子串时用栈处理一下即可 /* 枚举交换两个括号的位置,然后再对新的序列判一次即可 */ #incl ...