SELECT CONCAT(‘alter table ‘, TABLE_NAME , ‘ drop foreign key ‘, constraint_name, ‘;‘)
FROM information_schema.KEY_COLUMN_USAGE a WHERE a.TABLE_SCHEMA=‘某一个数据库的名称‘ AND a.constraint_name LIKE ‘FK_Reference_%‘ AND REFERENCED_TABLE_NAME=‘某一张表的名字‘
时间: 2024-10-03 01:57:15