Get month name from file using ssis 2008

  • 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.

  • Quick question first. How is the package going to know which file to load?



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for 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]

  • There will be one file once a month at a particular location with the filename as mentioned above.

  • 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.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for 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