I am creating an SSIS package that will write in the header of a text file
STARTDATE|ENDDATE|ROWCOUNT
followed by the results of a stored procedure. ROWCOUNT is the number of rows in the data set from the stored procedure. The data set is written to the body of the flat file.
My package is successful. It has three data flow tasks:
DetermineRowCount,
WriteHeader, and
WriteData.
DetermineRowCount and WriteData both hit a copy of the same OLE DB Source - Data item.
DetermineRowCount data flow is OLE DB Source - Data ---> Row Count where the RowCount variable is set.
I would like to eliminate one copy of the OLE DB Source - Data.
Is there a way to obtain the RowCount and the data, write the header, then write the body, without calling the stored procedure twice?