• The same solution still stands: you write your data to the flat file. Meanwhile, you store the row count in a variable.

    In the next step, you add the header and footer using a script task that reads the SSIS variable.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP