Getting excel filename in ssis
-
Friday, February 22, 2013 8:14 PMI would like to know if there is a way I could extract the filename of my excel files to be reflected in my destination database. I'll appreciate your help in regards to this issue
All Replies
-
Friday, February 22, 2013 8:17 PM
Hello,
A Similar question has been answered here at Stack Overflow. You can either use the File Enumerator and split the result set to a variable or write a script task to get the File name.
Regards, Dinesh
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Tuesday, March 05, 2013 5:33 AM
-
Friday, February 22, 2013 8:42 PMModerator
Are you using a foreach loop to loop through the files? If so you have a variable filled with the filepath of the excel file. With an expression you can get the filename only:
RIGHT(@[User::FilePath],FINDSTRING(REVERSE(@[User::FilePath]),"\\",1) - 1)
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Tuesday, March 05, 2013 5:33 AM

