Excel source changes name everyday
So here is my problem. We have excel files that get emailed to us everyday but they never have the same names. is there a way to make the excel source use like and excel file in a curtain folder? or a work around other then renaming the file everyday?
June 13th, 2011 3:49pm

I also had to develop a similar package. I would use the ForEach Loop to get the name of the file. Save it aside in a "shadow" folder and then process. This way you do not care of the file name. See my blog post: http://geekswithblogs.net/Compudicted/archive/2011/05/17/how-to-ftp-and-process-anyhow-named-file.aspxArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2011 4:02pm

I don't completely understand. The foreach loop is int eh control flow tab and the excel source is in a data flow task?. maybe I'm just missing something here
June 13th, 2011 4:14pm

Yes, Foreach loop is in control flow, it will extract the file name for you and then inside foreach loop you have Data Flow and that data flow uses the Execel Source Connection. You will be using File Name provided by Foreach in expressions for Excel Connection manager. Check following links http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx http://www.sqlshare.com/looping-through-and-loading-files-with-ssis_34.aspx Thankshttp://sqlage.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
June 13th, 2011 4:18pm

One way could be that you have a folder to store the files irrespective of there names. Once the package starts use a foreach loop on this folder and process all the files. On each file's successful processing archive the file to another location and delete the current file. This way your folder will have only unprocessed files and when you get a new file directly save it to this location. My Blog | Ask Me | Test your SSIS skills
June 13th, 2011 4:58pm

In Excel Connection Manager properties , Select the expressions property ExcelFilePath and map the variable which you have used in for each loop container to extract the filename. In For Each Loop Container,the Retrieve file name should be fully qualified to get file name with file path.
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2011 2:13am

In Excel Connection Manager properties , Select the expressions property ExcelFilePath and map the variable which you have used in for each loop container to extract the filename. In For Each Loop Container,the Retrieve file name should be fully qualified to get file name with file path.
June 14th, 2011 9:10am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics