重复创建mysql表脚本
1 Create Table If Not Exists 库名
.表名
(
2 字段列表3 ) ENGINE=InnoDB DEFAULT CHARSET=uft8 COMMENT=‘表名描述’
重复创建mysql字段脚本
/=====bigint DBeaver tool 执行脚本 ======/
DROP PROCEDURE if exists add_tal_column;DELIMITER ####CREATE PROCEDURE add_tal_column() begin IF NOT EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=‘库名’ AND TABLE_NAME=‘表名’ AND COLUMN_NAME=‘字段名’) then 添加已有表字段脚本 end if;END####delimiter;CALL add_tbl_columnDROP PROCEDURE add_tbl_column;/=====end DBeaver tool 执行脚本 ======//=====bigint Navicat Premium tool 执行脚本 ======/DELIMITER $$DROP PROCEDURE if exists add_tal_column;CREATE PROCEDURE add_tal_column() begin IF NOT EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=‘库名’ AND TABLE_NAME=‘表名’ AND COLUMN_NAME=‘字段名’) then 添加已有表字段脚本 end if;END;CALL add_tbl_columnDROP PROCEDURE add_tbl_column;/=====end Navicat Premium tool 执行脚本 ======/