mysql循环insert多条数据

DROP PROCEDURE IF EXISTS proc_initData;-- 如果存在此存储过程则删掉
DELIMITER $
CREATE PROCEDURE proc_initData()
BEGIN
    DECLARE i INT DEFAULT 1;
    WHILE i<=15000000 DO
	INSERT INTO t_fam_alert values(i,5,'123','dectId','dectCode','15000','14000','1300',1,'facuId','testest',0,'decType','facuCode','facuType',1);
        SET i = i+1;
    END WHILE;
END $
CALL proc_initData();

 

你可能感兴趣的:(代码常用知识)