I've just got back from a Charlatans gig at Hammersmith Palais in London. Anyone that knows me will tell you that I'm a massive massive Charlatans fan so I've had a great night. They played alot of stuff from earlier albums like "With No Shoes" from Tellin' Stories, "Inside Looking Out" from Up To Our Hips and "Here Comes A Soul Saver" from the eponymous fourth album; songs that I never thought I'd ever hear live again so after the gig I was buzzing.
But, even given all that, I'm down in the dumps cos soon after I realised that some b*****d tea-leafed my Pentax Optio S5i from right outta my pocket. I've only had it a few months and had a summer of music festivals, camping trips and lazy days in the sun planned in which to really get some use out of it - not any more. The missus has been sympathetic but I don't think she truly understands the pain a gadget freak such as myself goes through in these situations.
Anyway, it means that I'm wide awake contemplating the ills of the world so plenty o'time to do some much needed blogging before Mark overtakes me in the Conchango blogging leaderboard :)
I've recently been in touch with Richard Lees, a kiwi living in Sydney, who has been making his first steps on the treacherous road to SSIS enlightenment. Richard was having a bit of grief understanding how to use the Foreach loop container to loop over a load of files in a folder so I put together this simple downloadable demo to illustrate the concept.
To use the package you need to place the 3 enclosed text files into your "C:\Temp" folder and make sure there are no other "*.txt" files in there. Then simply run the package. It does a number of things:
- Enumerates all the files in "C:\Temp" matching the wildcarded string "*.txt"
- Maps the file path of the currently enumerated file to a variable User::FileName
- Uses a property expression on the ConnectionString property of a Flat File Connection Manager to point to the file indicated by User::FileName
- Process the file (which in this demo simply passes all the data into a Recordset destination)
I hope this alleviates some of the pain people are having in using the file enumerator in the Foreach container. Its a wonderfully powerful feature of SSIS and will have many uses as SSIS gets unleashed unto the masses.
Meantime, I am going to leave you, stick on my most downbeat Radiohead CD and return to my morose mourning for my beloved camera!!!