November 24, 2009 at 8:25 am
I was using the TechNet tutorial:
How to: Loop through Excel Files and Tables by Using a Foreach Loop Container
It all seems to work great, except that my For each file loop isn't picking up the actual file name of the Excel file and passing it to the variable.
I have the for each file enumerator, it points to a folder: "C:\Current Data Processing" and files: "*.xls" to retrieve the fully qualified name.
In variable mappings I created a variable of type string with scope as the name of my SSIS package and the index in the variable mappings is 0.
(Can someone explain index by the way, I don't understand that. Do some variable mappings provide a range of columns/indexs I could place this stuff in? How do I view that to see what my options are? But that's a less pressing question)
Now the package runs just fine, but only because it points to the hard coded value I entered into the variable. If I remove that the package fails to run.
I don't understand why my Foreach loop container isn't putting the name of the excel file in my C:\Current Data Processing folder into the variable"ExcelFile"?
Thanks!
November 24, 2009 at 11:00 am
[font="Comic Sans MS"]
Hi Maxer,
From description it's a little difficult to understand if you have missed something. You can check this out :
http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx
Did this help?
[/font]
[font="Comic Sans MS"]--
Sabya[/font]
November 24, 2009 at 1:04 pm
Finally got it sorted.
Ended up using a script task to msgbox out the value each time to ensure it was doing what it was supposed to.
Turns out it was.... which was VERY perplexing.
Recreated the project, now I'm thinking I may have screwed up by not setting the expression to set the connection string in one of the connectors that the solution was using.
Have redone the solution, it seems to be working now.
I think I must have either not gotten the entire expression in there, or blanked out one of the connection strings by accident. Either way, it is doing it's job! 🙂
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply