Re-order switch statements. No functional change.
added insert statement for customtables again (still needed by ChangeTrigger)