update sql and add cleanSql for trigger