Created
April 10, 2013 17:44
-
-
Save Rican7/5356824 to your computer and use it in GitHub Desktop.
Easily add test data via a procedure loop. :)
This file contains 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 addTestData; | |
delimiter // | |
CREATE PROCEDURE addTestData(cnt INT) | |
BEGIN | |
SET @x = 0; | |
REPEAT | |
SET @x = @x + 1; | |
INSERT INTO `TABLE_NAME_HERE` (`name`) VALUES ( CONCAT( 'test_data_', @x) ); | |
UNTIL @x >= cnt END REPEAT; | |
END | |
// | |
call addTestData(100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment