SSIS - Empty flat file

  • What is the best way to ensure that a flat file isn't created if no exceptions are found in the data.

    For example. Loop over a set of files, read and process through a conditional split (with business logic applied). Output for the conditional split is to write to a new flat file (valid data) or an exception file.

    An exception file is always created even if no rows go down the exception stream.

    Can someone advise me on how I can stop an empty file being created rather than deleting it after with a file system task.

    Thank you

  • Hi,

    This should not be much of a problem...

    Adjust the precedence constraint you are using and add necessary constraints and/or expression....;-);-);-)

    Raunak J

  • the writing of the flat file is in the dataflow so I won't be able to adjust the precedence constraint?

  • In that case you might have to alter your design brother!!!:cool::cool:;-)

    Raunak J

  • Thank you for the responses. I have a solution now.

    The issue I found with the row count was setting and using it in the same data flow.

    Solution:

    I wrote the exceptions to a table in 1 data flow.

    Took a row count from the exception table in a 2nd data flow.

    Then had an expression and success constraint on the link to the 3rd data flow.

Viewing 5 posts - 1 through 5 (of 5 total)

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