how to get row count value to destination file

hi,

I have a requirement in which i need to pull records from a table and load into destination flat file ..and at end of file it should display row count

for e: like this

" rowcount: 40 records" ..

i tried placing rowcount transformation in between source and flat file destination..i am able to get all records in file but unable to pull value of variable where i stored row count into that file...any suggestions on how to do that?

thanks


  • Edited by ssisguy Friday, September 11, 2015 2:30 AM
September 11th, 2015 2:30am

Hi,

I think after the dataflow task for pulling the records to Flatfile, you can add a Script Task on the control flow to append the count captured by variable in rowcount task to the flatfile. Make sure you set the scope correct for the variable used to capture count of rows.
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 6:15am

Hi,

I think after the dataflow task for pulling the records to Flatfile, you can add a Script Task on the control flow to append the count captured by variable in rowcount task to the flatfile. Make sure you set the scope correct for the variable used to capture count of rows.
September 11th, 2015 6:15am

Hi,

According to you i added script task in control flow  ..after some research i found this code ..

  public void Main()
        {
            // TODO: Add your code here
            string Variables = Dts.Variables["User::LineRecordCount"].Value.ToString();
            MessageBox.Show(Variables);
            Dts.TaskResult = (int)ScriptResults.Success;
        }

but this one display the count using message box..i want to know how to attach that variable in flat file..is there any function i can use ..to append variable

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 10:38am

i want to know how to attach that variable in flat file..is there any function i can use ..to append variable

http://microsoft-ssis.blogspot.com/2015/02/add-footer-to-flat-file.html
September 11th, 2015 5:23pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics