February 16, 2011 at 9:55 pm
Hi,
I will have excel file every month to load into a sqlserver table. For that I need to add a new colum named dateloaded. The file will be something like this 02-2011 FileName.xls for the month of feb. For march 03-2011 FileName.xls . I need to get the month and year from the filename and the dateloaded field should be 2011-01-01 for the month of Jan, 2011-02-01 for Feb. No matter whichever date the file is loaded for the current month, the date should be 01. I need to grab the month and the year.
How do I do that using derived colum ?
Please help
Thanks.
February 17, 2011 at 8:43 am
Quick question first. How is the package going to know which file to load?
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
February 17, 2011 at 9:48 am
There will be one file once a month at a particular location with the filename as mentioned above.
February 17, 2011 at 10:09 am
In the Control Flow, you could add a ForEach file container to hold your dataflow. Have the ForEach container pass the file name to a variable. Use that variable in your dataflow and then use the derived column to grab the date from it.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply