[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下samba共享服务器搭建详解
这两天业务需求搭了一台服务器.要求samba共享文件. 葡萄美酒月光杯的前戏就省了,我们直接上干货. 1.yum方式安装samba yum -y install samba 2.将/etc/sam ...
- C 语言sizeof运算符
#include<stdio.h> int main() { ; ); ; int size3 = sizeof a; int size4 = sizeof(a); int size5 = ...
- 使用python+ffmpeg批量转换格式
需求: 给定一个文件夹路径,遍历该文件夹内的所有文件以及子文件夹内的文件,当所有后缀名为wav格式的文件转换为ogg格式的文件. import os # 获取目录下的所有文件列表 import fn ...
- Cloudflare-为自己的网站&博客保驾护航
官网: https://www.cloudflare.com/zh-cn/ Cloudflare是什么? 优化功能,提升网站性能,提供SSL服务,提供安全防护,托管服务:为企业,非营利组织,博客等提供 ...
- Samba服务的安装
Samba的安装 1.准备环境 Centos7 [root@localhost ~]# systemctl stop firewalld [root@localhost ~]# setenforce ...
- 新手创建多module mvn工程
1.创建工程 创建一个mvn工程有两种方式,一种是通过命令创建,一种是通过idea去一步一步配置. 1.1 命令模式 mvn archetype:generate -DgroupId={groupId ...
- Web UI开发神器—Kendo UI for jQuery数据管理之过滤操作
Kendo UI for jQuery最新试用版下载 Kendo UI目前最新提供Kendo UI for jQuery.Kendo UI for Angular.Kendo UI Support f ...
- Case Closed?
Finally, we'll want a way to test whether a file we've opened is closed. Sometimes we'll have a lot ...
- 关于axios中post请求提交后变成get的问题
这个问题归结于自己的不细心,如下图. 头疼了好久,才发现是自己多写了一个s,在此记录一下.
- PHP FILTER_SANITIZE_EMAIL 过滤器
定义和用法 FILTER_SANITIZE_EMAIL 过滤器删除字符串中所有非法的 e-mail 字符. 该过滤器允许所有的字母.数字以及 $-_.+!*'{}|^~[]`#%/?@&= N ...