咱们先建个表吧
[SQL] 纯文本查看 复制代码
1
2
3
4
5
6
    CREATE TABLE `test1` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `test1` varchar(255) NOT NULL DEFAULT '',
  `test2` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8

然后再执行sql
[SQL] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
drop PROCEDURE if exists  test1;
 
DELIMITER  $$
create PROCEDURE test1(var1 varchar(10))
BEGIN
    DECLARE i int;
    set i = 0;
    while i < 10000 do
        insert into  test1   values ( null ,concat(var1, i), i);
        set i = i + 1;
    end while;
end;
 
DELIMITER;


最后执行一次sql
class test1('abc');
 

相关文章:

  • 2022-02-26
  • 2021-11-19
  • 2021-12-14
  • 2022-02-25
  • 2021-12-25
  • 2021-07-23
  • 2021-08-17
  • 2021-09-04
猜你喜欢
  • 2021-04-16
  • 2021-05-18
  • 2021-09-14
  • 2022-01-01
  • 2022-03-10
相关资源
相似解决方案