Home Forums Data Warehousing Integration Services Data Flow Script Transformation and Pre/PostExecute methods - when do they run RE: Data Flow Script Transformation and Pre/PostExecute methods - when do they run

  • I've run some more tests and what I'm getting is that the PreExecute() executes as soon as the entire data flow starts, the PostExecute() executes as soon as the data flow finished and control passes back out to the Control Flow. I proved it by simply creating a dataflow that extracted 5 records, used the transform to count them and then cheated and put another script transform afterwards so I could use the message box. Sure enough I got the message box showing no records were processed. But a message box in the Control Flow after the data flow task showed the correct database.

    The reason for wanting the count is that I don't have control in this instance of the destination table structure so I can't add any additional fields on to capture whether the transformation took place or not.

    Now I know what it happening it will stop me from falling into the same trap again and trying to use the transformation for something it is actually not designed to do. Having been to the pub for lunch I have now realised my error and put a RowCount on the pipes to catch the number of changes being made and handling this back out in the Control Flow where it belongs.

    As usual with me, trying to fit a square peg into a round hole 🙂


    ---------------------------------------
    It is by caffeine alone I set my mind in motion.
    It is by the Beans of Java that thoughts acquire speed,
    the hands acquire shaking, the shaking becomes a warning.
    It is by caffeine alone I set my mind in motion.