none
2008R2: data flow script transform. FireError is being ignored

    Question

  • Hi all,

    I'm trying to pipe all duplicates in my source into an error table and raise an error in the data flow.

    i've added a "COUNT() OVER (partition by business key) AS Dupes"to my source select statement then use a conditional split to redirect all Dupes > 1 rows to a separate output. I've put in a script transform task after it with the following code

    bool Error = true;
    this.ComponentMetaData.FireError(1, "Script Component", "my Error message!", "", 0, out Error)

    in the hope that this'll raise an error in the data flow and let my error handling pick up that something went wrong

    But the data flow continues merrily along even though I can see a few dozen rows get redirected down the duplicate path and execute the script transform.

    What have I done wrong?


    Jakub @ Adelaide, Australia


    • Edited by jakubk Monday, March 03, 2014 12:17 AM
    Monday, March 03, 2014 12:17 AM

Answers

  • Nevermind! I hadn't looked at the control flow page, just at the data flow (of course it turns green, the code executed successfully). The control flow component failing is what I was after and it's working as expected.


    Jakub @ Adelaide, Australia

    Monday, March 03, 2014 12:33 AM
  • Hi,

    FireError in Script Component does not stop the entire data flow from running. The error merely propagates back to the Data Flow task, back to the Control Flow, in which SSIS will decide whether to fail based on the properties.

    To force a stop in the data flow, you need to throw an exception in your script.

    Hope this helps.
    ~ J.

    Monday, March 03, 2014 3:48 AM

All replies

  • Nevermind! I hadn't looked at the control flow page, just at the data flow (of course it turns green, the code executed successfully). The control flow component failing is what I was after and it's working as expected.


    Jakub @ Adelaide, Australia

    Monday, March 03, 2014 12:33 AM
  • Hi,

    FireError in Script Component does not stop the entire data flow from running. The error merely propagates back to the Data Flow task, back to the Control Flow, in which SSIS will decide whether to fail based on the properties.

    To force a stop in the data flow, you need to throw an exception in your script.

    Hope this helps.
    ~ J.

    Monday, March 03, 2014 3:48 AM