-- Variables
SET @start_id := 35000;
SET @end_id := 36383;
-- Drop procedure, if it still exists, somehow..
DROP PROCEDURE IF EXISTS populate_creature_model_info;
-- Change delimiter, so we can create the procedure.
DELIMITER $$
-- Procedure that will populate the table.
-- Unfortuntatly, we can't use a while loop outside a 'begin' and 'end' block.
CREATE PROCEDURE populate_creature_model_info(_start INT, _end INT)
BEGIN
WHILE (_start <= _end) DO
INSERT INTO creature_model_info(DisplayID) VALUES(_start);
SET _start = _start + 1;
END WHILE;
END$$
-- Change delimiter back to what it was.
DELIMITER ;
-- Delete already existing data.
DELETE FROM creature_model_info WHERE DisplayID BETWEEN @start_id AND @end_id;
-- Call the procedure and populate the table.
CALL populate_creature_model_info(@start_id, @end_id);
-- Drop procedure
DROP PROCEDURE IF EXISTS populate_creature_model_info;