Modified the trigger/sequence for SQL-statement.