mysql 批量插入

DROP PROCEDURE if EXISTS test_insert;

DELIMITER ;;

CREATE PROCEDURE test_insert()

BEGIN

DECLARE y BIGINT DEFAULT 1;

WHILE y<1000

DO

INSERT INTO test.demo (id, name) VALUES (y, CONCAT('test',y));

SET y=y+1;

END WHILE ;

commit;

END;;

CALL test_insert();

posted @ 2021-12-16 15:06  北方有鱼  阅读(96)  评论(0编辑  收藏  举报