Is there a way to dynamically change the column names in a flat file destination?

  • I want to create an ssis package to query our db and output to a text file. It would be run for different clients. The query would be the same, but some of the column names may change depending on the client. Is there a way to set the names of the columns dynamically - maybe inside of a script task?

    Thanks.

  • You might want to look at utilizing the OpenRowset function to write the data to the file instead.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Within a Dataflow task the metadata (column names/column count) cannot change at run-time. If you work with the same column count but the source has a different name with the same data-type, you could just use the query to change that column name to a standard name.

    You could also handle it with a script task.

    Come to think of it CozyRoc has a Data-Flow Plus component that might be able to do what you are talking about.

    CEWII

Viewing 3 posts - 1 through 2 (of 2 total)

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