Quantcast
Viewing all articles
Browse latest Browse all 24688

Creating Two Output files from a Dynamically Created Table

         

I have a requirement, to create two output flat files.  

1. A file containing all the records from a table (FlatFileTab1)
2. A file Containing the record count from the above table (Nothing else just a rec count number in it)

The FlatFileTab1 is created & populated dynamically from a SP which is called from PKG and in the end of the package I need to drop the table.

So far what I did..

1. Created a ESQL task1 to load the details of path where the output files to be placed(which is present in db table), captured the entire path in a pkg variable 
   in the same ESQL task1 also added a line to execute the SP -- This is working fine
2. Created the ESQL task2 to capture the table_name(FlatFileTab1) and the record count of FlatFileTab1 in the package variables, --This is also working till here
3. Now I created the DataFlowTask in which OLDB source and Flatfile destination, ConnManager for both of them.
   In the CM for flatfile, I am dynamically getting the target path from a package variable appending the date to it. I have constructed the file name and path in the expression editors "connection string of flat file Connection manager"

   It works fine for loading the flatfile(datafile) so for, Now at the same path, for adding another file (that is rec count file)
   I added a Multi cast to split 2 destinations a Derived colum to get the rec count variable.

   But here the problem is how have a different name for rec count file? how to change this dynamically to have a diff name?
   it will give the same flat file name with little diff in time factor of the file name


Neil


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>