[Err] 1701 - Cannot truncate a table referenced in a foreign key constraint
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的更多相关文章
- 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 ...
- 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' ...
- ORA-02266: unique/primary keys in table referenced by enabled foreign keys
在数据库里面使用TRUNCATE命令截断一个表的数据时,遇到如下错误 SQL >TRUNCATE TABLE ESCMOWNER.SUBX_ITEM ORA-02266: unique/prim ...
- 关于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 ...
- MySQL添加外键报错 - referencing column 'xx' and referenced column 'xx' in foreign key constraint 'xx' are incompatible
MySQL给两个表添加外键时,报错 翻译意思是:外键约束“xx”中的引用列“xx”和引用列“xx”不兼容 说明两个表关联的列数据类型不一致,比如:varchar 与 int,或者 int无符号 与 i ...
- SQL Server 2008 R2——TRUNCATE TABLE 无法截断表 该表正由 FOREIGN KEY 约束引用
=================================版权声明================================= 版权声明:原创文章 禁止转载 请通过右侧公告中的“联系邮 ...
- 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 ...
- sqlserver truncate清空表时候,无法删除 'B表',因为该表正由一个 FOREIGN KEY 约束引用。
外键: 查询:select object_name(a.parent_object_id) 'tables' from sys.foreign_keys a where a.referenced_ ...
- 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 ...
随机推荐
- vmware安装minimal centos报错/etc/rc5.d/s99local : line:25 : eject : command not found
今天在用centos mini 版的时候创建虚拟机出现错误提示:vmware安装minimal centos报错/etc/rc5.d/s99local : line:25 : eject : comm ...
- Java中的集合和线程安全
通过Java指南我们知道Java集合框架(Collection Framework)如何为并发服务,我们应该如何在单线程和多线程中使用集合(Collection). 话题有点高端,我们不是很好理解.所 ...
- mac vscode 实用快捷键
cmd+del:光标左边删到头 cmd+fn+del:光标右侧删到头
- enovia plm export to sap
UPC creation UPC 结构 PLM 使用的UPC 是 14个数字组成的,兼容. 前两位为 0,后12位为有效数字,在SAP中0会被忽略,符合国际UPC通用 规则, 前一位为0,后13 位为 ...
- Android多线程:深入分析 Handler机制源码(二)
前言 在Android开发的多线程应用场景中,Handler机制十分常用 接下来,深入分析 Handler机制的源码,希望加深理解 目录 1. Handler 机制简介 定义一套 Android 消息 ...
- JavaScript常用技巧之时间操作
1.获取当前时间戳 +new Date Date.parse(new Date())
- 启动AutoCAD时自动加载.NET开发的DLL
程序组织,建立名为*.bundle的文件夹,创建Contents子文件夹,并将dll,ico等文件放进Contents中,在*.bundle中创建PackageContents.xml文件,内容如下: ...
- Ubuntu系统管理systemd
systemctl命令 systemctl list-units - 列出所有jobs/serviceList all units (where unit is the term for a job/ ...
- ApiCloud如何一键真机测试
首先假设你已经有了APICloud账号,并创建了App项目. 需要注意的是,手机和电脑需要连接在同一wifi环境下. 第一步 下载自定义Loader 进入“开发控制台” 点击我们的项目 选择模块,再选 ...
- 【leetcode】973. K Closest Points to Origin
题目如下: We have a list of points on the plane. Find the Kclosest points to the origin (0, 0). (Here, ...