`

mysql存储过程

阅读更多
Description:插入大量测试数据
use xmpl;

drop procedure if exists mockup_test_data_sp;

create procedure mockup_test_data_sp(
	in number_of_records int
)
begin
	declare cnt int;
	declare name varchar(20) default 'test';
	set cnt = 1;
	
	while cnt <= number_of_records do
		insert into secondary_test_tbl(name) values (concat('aaa', '-', cnt));
		set cnt = cnt + 1;
	end while;
end;

call mockup_test_data_sp(200000);
0
2
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics