Failing Package

  • Hi all,

    My requirement is -

    While inserting into a destination table, if any error has occurred (due to bad data), I need to log it and fail the package only if threshold is reached. The threshold is pre-defined in a variable 'Threshold'.

    Example -

    Suppose I have 10 bad records coming into the destination, and assume that the Threshold is set to 8. Until 7 records, I need to log the error information. At the 8th record, I need to fail the package.

    My approach -

    I've set the configured the error output of OLEDB destination to "redirect row". I've connected the error port to a script component (where I have a counter and I check if the counter has exceeded Threshold). When threshold is reached, I'm firing the error (using "Me.ComponentMetadata.FireError" function). Please refer to the screenshot

    The problem here, is that when the error is fired at the 8th record, the package is not failing. It's processing all the records, and then failing the package is returning a failure saying - "Package returned Failure because the number of errors (3) exceeded the maximumerrorcount (1)". I do not want this. I want to abort the execution as soon as the threshold value is reached.

    Is there something I'm missing here? Kindly suggest me a solution to this.

    Thanks in advance,

    Manohar.

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply