Help needed on generating SSIS output file dynamically?
Hi Team, I need a help on a solution in SSIS. I want to generate a delimited flat file. Here delimiters must be passed dynamically through variables. If i give ",", the file must generate with comma delimited text file. If i give "|", then the file must be pipelined delimited file. Please let me know how to implement this. Rgds, Shree
July 19th, 2012 3:09am

I don't think you can put an expression on the delimiter of the flat file connection, so we'll have to use a workaround. Store the delimiter in a string variable, for example @myDelimiter. Create the following expression in a derived column where you concatenate all your columns together: column1 + @myDelimiter + column2 + @myDelimiter + ... + @myDelimiter + columnN If any column has another datatype than string, you need to cast it to string first. At the end, write this concatenated column to your flat file.MCTS, MCITP - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2012 3:15am

Hi Koen Verbeeck, Thanks for your post. It seems we can do this script component only and not in Flat file destination. Am i right? Rgds, Shree
July 19th, 2012 3:32am

If you have your concatenated column already calculated by the derived column, you can use a flat file destination. Or you can do everything in a script component. Concatenate in .NET and write it immediately to a file. Whatever you feel most comfortable with.MCTS, MCITP - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2012 3:35am

I think this example would be easy as compare to script task. It will generate the desired result quickly. I don't think you can put an expression on the delimiter of the flat file connection, so we'll have to use a workaround. Store the delimiter in a string variable, for example @myDelimiter. Create the following expression in a derived column where you concatenate all your columns together: column1 + @myDelimiter + column2 + @myDelimiter + ... + @myDelimiter + columnN If any column has another datatype than string, you need to cast it to string first. At the end, write this concatenated column to your flat file. Mustafa
July 19th, 2012 5:24am

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

Other recent topics Other recent topics