Is possible to write a script to generate sql triggers for each automatically?
<p>I have to create triggers for each of my tables that I have in my server. These 3 triggers would be for my table employees for example: </p>

<pre><code>DELIMITER $$
DROP TRIGGER IF EXISTS auditemployees_insert$$
CREATE TRIGGER auditemployees_insert AFTER INSERT ON employees

FOR EACH ROW
BEGIN
INSERT INTO employees_trigger (emp_no, birth_date, first_name, last_name, gender, hire_date) SELECT emp_no, birth_date, first_name, last_name, gender, hire_date FROM employees WHERE emp_no = NEW.emp_no;
END$$

DROP TRIGGER IF EXISTS auditemployees_delete$$
CREATE TRIGGER auditemployees_delete BEFORE DELETE ON employees

FOR EACH ROW
BEGIN
INSERT INTO employees_trigger (emp_no, birth_date, first_name, last_name, gender, hire_date) SELECT emp_no, birth_date, first_name, last_name, gender, hire_date FROM employees WHERE emp_no = OLD.emp_no;
END$$

DROP TRIGGER IF EXISTS auditemployees_update$$
CREATE TRIGGER auditemployees_update BEFORE UPDATE ON employees

FOR EACH ROW
BEGIN
INSERT INTO employees_trigger (emp_no, birth_date, first_name, last_name, gender, hire_date) SELECT emp_no, birth_date, first_name, last_name, gender, hire_date FROM employees WHERE emp_no = NEW.emp_no;
END$$


DELIMITER ;
</code></pre>

<p><strong>The questions are:</strong></p>

<p>What kind of script/language I can use to generate these triggers for each of my tables?</p>

<p>Is it even possible?</p>