通过存储过程向数据库sys_member表中插入10万条数据:
向苏汽系统中Mysql插入批量数据(构造10万条数据):
第1种方法:通过存储过程实现
DROP PROCEDURE IF EXISTS my_insert;
CREATE PROCEDURE my_insert()
BEGIN
DECLARE n int DEFAULT 0;
loopname:LOOP
insert into sys_member(factory_id, password, mem_type, login_name, role, name, mobile, created_by, save_from, status) values('1', '21218CCA77804D2BA1922C33E0151105', '10001-30', 'liyadong', '4', '李亚东', '13816573671','13863918154' ,'10010-50', '10006-30'); SET n=n+1;
IF n=100000 THEN
LEAVE loopname;
END IF;
END LOOP loopname;
END;
CALL my_insert();
标签:10,END,loopname,数据库,万条,insert,my
From: https://blog.51cto.com/jcy58/6434267