SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Refresh flat file source columns from change in Foreach Loop Container


Refresh flat file source columns from change in Foreach Loop Container

Author
Message
Luv SQL
Luv SQL
SSC Eights!
SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)

Group: General Forum Members
Points: 894 Visits: 130
I have an integration that works great and took a while to get it setup to work properly. I now need to modify the Foreach Loop Container to point to different files that have different columns. I modified the Foreach Look to point to the new files (eg. NewFiles*.csv). The flat file source Data Task within the Foreach Loop container is not reflecting the new columns. There is no option of refreshing the columns.

How do I refresh the source when the foreach loop changes? I'd really like to avoid having to redo everything.
ZZartin
ZZartin
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24887 Visits: 16875
If you're asking if SSIS will automatically update the source definition when the file format changes it won't.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)

Group: General Forum Members
Points: 210962 Visits: 24512
Luv SQL - Wednesday, March 7, 2018 9:59 AM
I have an integration that works great and took a while to get it setup to work properly. I now need to modify the Foreach Loop Container to point to different files that have different columns. I modified the Foreach Look to point to the new files (eg. NewFiles*.csv). The flat file source Data Task within the Foreach Loop container is not reflecting the new columns. There is no option of refreshing the columns.

How do I refresh the source when the foreach loop changes? I'd really like to avoid having to redo everything.

Column names and properties are set at design time only, so you will have to do this in VS and not at run time.
Even if SSIS could read the modified source columns, it would not know how to process them or where to map them.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Luv SQL
Luv SQL
SSC Eights!
SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)

Group: General Forum Members
Points: 894 Visits: 130
I'm doing the changes in VS. I don't see any options to update column definitions. If I wasn't using the ForEach Loop it wouldn't be an issue.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)

Group: General Forum Members
Points: 210962 Visits: 24512
Luv SQL - Wednesday, March 7, 2018 10:57 AM
I'm doing the changes in VS. I don't see any options to update column definitions. If I wasn't using the ForEach Loop it wouldn't be an issue.

Are you using a File Connection? Did you update that?



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Luv SQL
Luv SQL
SSC Eights!
SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)

Group: General Forum Members
Points: 894 Visits: 130
I've deleted both my flat file source and ole db destination and re-added. Since I'm using a ForEach Loop the flat file source references the flat file connection and not an individual file. When I run it now after the changes, it no longer runs grrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr. The data flow is inside the forloop so am not sure why it doesn't work anymore.

Started: 2:49:31 PM Error: 2018-03-07 14:49:32.13
Code: 0xC020200E Source: Data Flow Task Flat File Source [2] Description: Cannot open the datafile "". End Error Error: 2018-03-07 14:49:32.13
Code: 0xC004701A Source: Data Flow Task SSIS.Pipeline Description: Flat File Source failed the pre-execute phase and returned error code 0xC020200E.
End Error
DTExec: The package execution returned DTSER_FAILURE (1). Started: 2:49:31 PM Finished: 2:49:32 PM Elapsed: 0.187 seconds. The package execution failed. The step failed.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)

Group: General Forum Members
Points: 210962 Visits: 24512
Luv SQL - Wednesday, March 7, 2018 1:04 PM
I've deleted both my flat file source and ole db destination and re-added. Since I'm using a ForEach Loop the flat file source references the flat file connection and not an individual file. When I run it now after the changes, it no longer runs grrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr. The data flow is inside the forloop so am not sure why it doesn't work anymore.

Started: 2:49:31 PM Error: 2018-03-07 14:49:32.13
Code: 0xC020200E Source: Data Flow Task Flat File Source [2] Description: Cannot open the datafile "". End Error Error: 2018-03-07 14:49:32.13
Code: 0xC004701A Source: Data Flow Task SSIS.Pipeline Description: Flat File Source failed the pre-execute phase and returned error code 0xC020200E.
End Error
DTExec: The package execution returned DTSER_FAILURE (1). Started: 2:49:31 PM Finished: 2:49:32 PM Elapsed: 0.187 seconds. The package execution failed. The step failed.

You've got that round the wrong way. The source component in your dataflow references the flat file source. The only way that you can process multiple files in a FEL like this is if the files all have the same format (Column names, number of columns, data types etc).



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Luv SQL
Luv SQL
SSC Eights!
SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)

Group: General Forum Members
Points: 894 Visits: 130
They do have all the same column names....I'm simply changed it from a bunch of *Summary*.csv files to *Detailed*.csv files (the destination has already been changed to reflect the new column names).

All of the Summary and Detail files are identical with the same columns, same number of columns, same data types. It worked yesterday with my summary files and now won't work with the detail files. Even with a SINGLE csv file (so there is no chance of any differences between the files) it does not run anymore.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)SSC Guru (210K reputation)

Group: General Forum Members
Points: 210962 Visits: 24512
Luv SQL - Wednesday, March 7, 2018 1:30 PM
They do have all the same column names....I'm simply changed it from a bunch of *Summary*.csv files to *Detailed*.csv files (the destination has already been changed to reflect the new column names).

All of the Summary and Detail files are identical with the same columns, same number of columns, same data types. It worked yesterday with my summary files and now won't work with the detail files. Even with a SINGLE csv file (so there is no chance of any differences between the files) it does not run anymore.

Can you confirm that you are using separate flat file sources for Summary and Detailed files and that you have one FEL for each (two FELs in total)? Also, that you have filtering in place on your FELs to avoid attempting to process files of the wrong type?



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Luv SQL
Luv SQL
SSC Eights!
SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)SSC Eights! (894 reputation)

Group: General Forum Members
Points: 894 Visits: 130
Fixed it. Forgot to add the Expression into the Source Connection Manager for my variable. D'OH!
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