mysql 创建存储过程

DROP PROCEDURE IF EXISTS test_proc;  
CREATE PROCEDURE test_proc()  
BEGIN  
declare i int default 0;  
set autocommit = 0;  
while i<10000000 do  
INSERT INTO BT ( ID,VNAME )  VALUES( i, CONCAT( 'M', i ) );  
set i = i+1;  
if i%2000 = 0 then  
commit;  
end if;  
end while;  
END; 
原文地址:https://www.cnblogs.com/gylhaut/p/9212148.html