标签:
Table Create Table -------- ----------------------------------------------------------tdefuser CREATE TABLE `tdefuser` ( `userId` int(11) NOT NULL auto_increment, `address` varchar(14) default NULL, `phone` varchar(14) default NULL, PRIMARY KEY (`userId`) ) ENGINE=MyISAM AUTO_INCREMENT=10001 DEFAULT CHARSET=latin1
--存储过程实现,autoInsert:
DELIMITER $$DROP PROCEDURE IF EXISTS `hibernate`.`autoInsert`$$CREATE DEFINER=`root`@`localhost` PROCEDURE `autoInsert`()BEGIN DECLARE i int default 1; WHILE(i < 10000) DO insert into tdefuser(address, phone) value (‘sz‘, ‘123‘); SET i = i+1; END WHILE; END$$DELIMITER ;
--完成,用call autoInsert();调用该SP.
mysql -- 循环插入数据到表中
原文地址:http://www.cnblogs.com/hf8051/p/4381583.html