Create dynamic text files of all tables

  • Hello,

    I'm hoping someone out there can help me out with a problem I'm having. I want to create a flat file of every table in a database. I used the foreach task to loop through a collection of records that have a sql statement. I'm then passing on that sql statement to the data flow task to dynamically extract the data I need. I'm stuck on how to configure the OLE DB source and Flat file destination tasks as the field names will be different with every recordset that gets pulled. How do you dynamically set the flat file destination properties?

    I know I could write a task for every table that I need to an extract, but I thought I use this opportunity to learn some advanced features of SSIS.

    Thanks

    J.D.

  • It appears after reading several different blogs that you cannot modify the metadata at runtime. Anyone have other suggestions?

  • Can you dynamically construct a bcp statement?

  • This may work for the time being. Thanks for the suggestion. After reading some of the parameters of bcp it doesn't appear to support headers. Is there no way to include column headers in the output file?

    Thanks

    J.D.

  • Have you considered using XML to do this - it would be fairly easy to set up a standard "header" stucture in an XML file describing the rest of the file....?

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

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

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