You can avoid such horrors by creating static trigger code for each table.
It isn't too difficult to write a scrpt to generate the triggers for you
based on the info schema views. In the long run the time spent designing
such a script is sure to prove worthwhile.