[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 ...
随机推荐
- linux文本处理工具篇
一.常用简单工具 cat [OPTION]... [FILE]... -E:显示行的结束符$ -n:对显示出的每一行进行编号. -A:显示所有控制符 -s:压缩连续空行为一行 more:分页查看文件 ...
- tee - 从标准输入写往文件和标准输出
总览 (SYNOPSIS) tee [OPTION]... [FILE]... 描述 (DESCRIPTION) 把 标准输入 的 数据 复制到 每一个 文件 FILE, 同时 送往 标准输出. -a ...
- redis数据操作篇
服务器端 服务器端的命令为redis-server 可以使⽤help查看帮助⽂档 redis-server --help 个人习惯 ps aux | grep redis 查看redis服务器进程su ...
- Android 增量更新完全解析 是增量不是热修复(转)
转自:http://blog.csdn.net/lmj623565791/article/details/52761658 本文在我的微信公众号:鸿洋(hongyangAndroid)首发. 转载请标 ...
- Image另存为其他格式
string imgPath = @"C:\ZHM01000001400001-01 青龙 白虎.tif"; Image img = Image.FromFile(imgPath) ...
- Clickhouse集群部署
1.集群节点信息 10.12.110.201 ch201 10.12.110.202 ch202 10.12.110.203 ch203 2. 搭建一个zookeeper集群 在这三个节点搭建一个zo ...
- python 爬取拉勾网
import requestsimport randomimport timeimport osimport csvimport pandas as pdreq_url = 'https://www. ...
- PHP ftp_exec() 函数
定义和用法 ftp_exec() 函数请求在 FTP 服务器上执行一个程序或命令. 如果成功,该函数返回 TRUE.如果失败,则返回 FALSE. 语法 ftp_exec(ftp_connection ...
- 冲刺$\mathfrak{CSP-S}$集训模拟赛总结
开坑.手懒并不想继续一场考试一篇文. 既没必要也没时间侧边栏的最新随笔题解反思相间也丑 而且最近越来越懒了竟然都不写题解了……开坑也是为了督促自己写题解. 并不想长篇大论.简要题解也得写啊QAQ. 目 ...
- 1245. Tree Diameter
解题思路:本题是一道图的题目,但是无向图,给定的输入是图的各个边,题目中给出一个关键信息(Each node has labels in the set {0, 1, ..., edges.lengt ...