MySQL 批量插入表数据的存储过程写法记录 发表于 2024-01-05 更新于 2024-09-26 分类于 MySQL篇 阅读次数: MySQL 批量插入表数据的存储过程写法记录 写法记录12345678910CREATE PROCEDURE insert_bulk(in max_num int(10))begin declare i int default 0; set autocommit = 0; repeat set i = i + 1; INSERT INTO `table`(xxx) VALUES (xxx); until i = max_num end repeat; commit;end; 调用1call insert_bulk(10000)