创建一个存储过程
CREATE DEFINER=`root`@`localhost` PROCEDURE `insert_test_data`()
BEGIN
## 增加测试数据,循环插入 指定数据条数
DECLARE i INT DEFAULT 1;
WHILE i<=10000 DO
## 要执行的 sql语句 ---开始
INSERT INTO `pms`.`t_sn_order_record_weight` ( `inventory_code`, `order_record_id`, `order_id`, `sn`, `box_name`, `type_doc`, `weight`, `sales_code`, `box_id`, `language`, `from_type`, `is_put`, `add_time`, `update_time`, `deleted`) VALUES ( '03-01-007-0001-00', 10005, 105189, '105189000001', '100052022070501', '汇报入库-普通生产', NULL, '250054123', 5, '中文', 3, 1, '2022-07-05 12:01:53', '2022-07-06 17:01:05', 0);
## 要执行的 sql语句 ---结束
SET i = i + 1;
END WHILE;
END
调用
call insert_test_data()