Exporting Data to FlatFile

  • Hey Guys, I needed assistance with exporting Data to Flatfile.

    I have placed following controls into package.

    DataFlowTask --> Exports data into a tab delimited flat file. Column names in first row enabled.

    Execute SQL Task --> Extract recordset from database

    ForEachLoop Container -> Data Flow Task --> Extract record per item and writes to the same file.

    There is a small glitch to this process. Each time the ForEachLoop executes, it appends column names before the data to the file.

    Is there any ways to turn this off within the for each loop via control settings? I have tried two approaches: Adding second connection manager with Column names turned off. Second, using expressions to enable/disable column names property in the connection manager. Both works. I am curios to know if it can be done via some quick settings.

    Thanks

    Manny

  • mannychohan (2/25/2015)


    Hey Guys, I needed assistance with exporting Data to Flatfile.

    I have placed following controls into package.

    DataFlowTask --> Exports data into a tab delimited flat file. Column names in first row enabled.

    Execute SQL Task --> Extract recordset from database

    ForEachLoop Container -> Data Flow Task --> Extract record per item and writes to the same file.

    There is a small glitch to this process. Each time the ForEachLoop executes, it appends column names before the data to the file.

    Is there any ways to turn this off within the for each loop via control settings? I have tried two approaches: Adding second connection manager with Column names turned off. Second, using expressions to enable/disable column names property in the connection manager. Both works. I am curios to know if it can be done via some quick settings.

    Thanks

    Manny

    Hi,

    No need for the for-each loop here...you can go directly from the record set (returned by your query) into the flat file. This will also solve the issues you have right now.

  • Why are you adding foreach loop?

  • I need to extract records from the table which have not been processed. Based on the resultset I receive, I will need to query different tables to extract record details and add those to the file.

    Thanks

  • mannychohan (2/26/2015)


    I need to extract records from the table which have not been processed. Based on the resultset I receive, I will need to query different tables to extract record details and add those to the file.

    Thanks

    Can you provide more information, and/or post a sample package. Without that it's a little difficult to grasp exactly what you are trying to do.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply