Created
December 25, 2013 09:30
-
-
Save pataiji/8121716 to your computer and use it in GitHub Desktop.
テストデータ大量インサートする時の備忘録
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP PROCEDURE IF EXISTS insert_data; | |
-- SQLの区切り文字を変更しておく | |
DELIMITER // | |
-- ストアドプロシージャを作成 | |
CREATE PROCEDURE insert_data() | |
BEGIN | |
SET @i:= 1; | |
WHILE(@i <= 10000000) DO | |
INSERT INTO test_table (`test_column`) VALUES (@i); | |
SET @i = @i +1; | |
END WHILE; | |
END; | |
// | |
-- SQLの区切り文字を戻しておく | |
DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
実行