Changes needed for handling triggers in custom SQL