Output 3 temporary tables into 1 text file?
Execute SQL Task executes an SP that divides data into 3 temporary tables. How can I output the 3 tables into 1 text file?
N/B: I need to retain the different column names from each of these 3 tables. Also, all the tables have different no. of columns.
May 18th, 2011 4:09am
Create a date flow task that takes data from these temp tables and do a Union All before taking the data to flat file destination.Nitesh Rai- Please mark the post as answered if it answers your question
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2011 4:57am
Execute SQL Task executes an SP that divides data into 3 temporary tables. How can I output the 3 tables into 1 text file?
If your Execute SQL Task filles three (temporary) tables... you can use a simple Data Flow Task with an OleDB source (for the tables) and a flatfile destination (for the text file) to create that textfile.
If all tables have the same format you can use an Union All query to get all data in the source:
f.e.
SELECT Column1, Column2 FROM Table1
UNION ALL
SELECT Column1, Column2 FROM Table2
UNION ALL
SELECT Column1, Column2 FROM Table3
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
May 18th, 2011 4:58am
Thanks guys. However, the problem is that I need to retain the different column names from each of these 3 tables. Also, all the tables have different no. of columns. Any more ideas? I'm really stuck on this one
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2011 6:00am
Thanks guys. However, the problem is that I need to retain the different column names from each of these 3 tables. Also, all the tables have different no. of columns. Any more ideas? I'm really stuck on this one
try this:
Just use three different dataflows with there own connection manager... (but use the same filepath)
In the Flat File Desination you can set a checkbox that indicated whether you should overwrite the file or append to the file. (The first should be on overwrite and the others should not overwrite)
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
May 18th, 2011 6:08am