Mysql —— 存储过程批量增加2000条数据
程序员文章站
2024-03-19 18:39:52
...
存储过程:
DELIMITER $$
CREATE
PROCEDURE addSuchData(in i int)
BEGIN
WHILE i < 2000 DO
INSERT INTO student VALUES(i,CONCAT('学生',CAST(i AS CHAR)));
SET i=i+1;
END WHILE;
END$$
DELIMITER ;
CALL addSuchData(0);