Assume the following scenario:
All data are in Sql Server tables.
1) An Execute SQL Task to determine if there are records to process by running a select against Table1.
2) If there are, an Execute SQL Task to truncate Table2.
3) A Data-flow task to Load Table2 with the results from the select against Table1.
Now, I can do that easily in a stored procedure, but am required to do it in SSIS.
So far, in the control flow, I've run my select and stored the results in a table variable, lets call it @ResultSet, and just for good measure, I have also created an object-type variable, let's call it MyResults also holding the resultset.
To avoid truncation of Table2 if @ResultSet is empty, I then count the number of records in @ResultSet and raise an error if the count is zero, effectively aborting the package.
Normally this is not the case, and instead of starting my Data-flow by running the same query against Table1 all over again, I would now like to access either my @ResultSet or my MyResults object like any other data source.
The latter should be possible using a scripting task, but I really, really don't want to go down that road.
Whether I can use my @ResultSet or come up with an entirely different approach due to your input, that is the question.
TIA.