Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Creating Dynamic Outputs in SSIS


Creating Dynamic Outputs in SSIS

Author
Message
Tim Mitchell
Tim Mitchell
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1247 Visits: 2943
Comments posted to this topic are about the item Creating Dynamic Outputs in SSIS



Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices


Steve Cullen
Steve Cullen
SSChasing Mays
SSChasing Mays (629 reputation)SSChasing Mays (629 reputation)SSChasing Mays (629 reputation)SSChasing Mays (629 reputation)SSChasing Mays (629 reputation)SSChasing Mays (629 reputation)SSChasing Mays (629 reputation)SSChasing Mays (629 reputation)

Group: General Forum Members
Points: 629 Visits: 1226
Nice article.

I try to use the ForEach container as much as I can. Saves lots of work.

Converting oxygen into carbon dioxide, since 1955.


Francisco Hurtado
Francisco Hurtado
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 186
Hi Tim,

wonderful article. However, when setting the vendor variable in the result set tab be sure to rename the property name (result name) to 0.

http://www.techsolutions55.com/microsoft/498b01c802393.php.

Thanks.

Francisco.
tony-591909
tony-591909
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 455
That worked for me. I was wondering what I did wrong. Thanks Francisco.
jananth
jananth
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 6
Nice article! I was wondering if I will be able to use configuration file for dynamically naming the output file. I have used dynamic out put file in some of my packages. But I could not use a configuration file for my settings while using file name dynamically. May be I am doing something wrong.
Tim Mitchell
Tim Mitchell
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1247 Visits: 2943
Jananth, you can use a configuration file to set the filename, but when used in the context of this example, the filename declared in the expression would win out at runtime. Are you trying to define the output folder (rather than the filename) in the config file? If that's the case, you could set a variable to define the output folder in the config file, and append your dynamic filename to that folder name.

Let me know if this answers your question.

hth,
Tim



Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices


jananth
jananth
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 6
I am trying to use the file name itself in the config file.
Tim Mitchell
Tim Mitchell
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1247 Visits: 2943
Sure, you can hard-code the filename in the config file if you want to use a single output file (rather than one file per iteration of the loop). Be aware that if you use repeating logic such as a ForEach loop, you'll need to set the flat file output to append rather than overwrite, otherwise you'll only get the data from the last iteration of the loop.

hth,
Tim



Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices


vvkp
vvkp
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 164
Hello,
Really nice article. I am newbie in this area.
Can I implement the same in my environment? here is the scenario.

1. I have lot of different tables data to be extracted to flat files like table1, table2, table3.....tableXXX.
2. I need to run select * from each table and capturing the data in flat files by naming the file as table name.
I am trying to use foreach loop in the case but getting error...I captured table names (table1, table2 etc.,) and Query (select * from table1, select * from table2 etc., ) to a temp table and then using the variables tablename and query as variables in the foreach loop container and ending with error.

So my question is ...can I use yours in my scenario? I heard some where that each table contains different columns and the each query leads to different columns and hence the columns are changing flatfile extraction is not possible. Is that correct?
Can you kindly suggest some method to my schenario?
Krishna.



Tim Mitchell
Tim Mitchell
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1247 Visits: 2943
Krishna,

Unfortunately, the most difficult scenarios to address are those with variable metadata. I understand that there are some custom components available for purchase that allow you to declare metadata outside the package (I think CozyRoc has something like this) but I've never used their tools so I can't speak to what they can or can't do.

An alternative could be to use a fully scripted solution (most likely a single Script Task) to read the file, create the table, and write the rows to the output.

hth,
Tim



Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search