Share via

Excel changing hourly

David Marques 1 Reputation point
2021-11-15T15:58:04.707+00:00

I have some excel files that got imported to a certain folder through ftp. this files are going to that folder hourly. every time an excel file goes into this certain folder it has all the accumulations of the excel files before, so only the most recent one matters. this basically means the moment i import a file i have to deleted since it won't matter any more. How can i automatize this process in ssis? i know i have excel source and foreach loop but i am not seeing how to do this because the objective is not to constantly change the "excel file path" in excel connection manager every hour obviously. i have searched and there are some people that do this in scripts but is kind of confusing and i am not sure if it is even related to my problem. can someone explain to me in detail how to do this?

SQL Server Integration Services
0 comments No comments

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 41,551 Reputation points
    2021-11-16T01:47:05.977+00:00

    Hi @David Marques ,

    You may use Script Task to delete all files in a folder except the latest one.

    Here is a detailed tutorial for your reference, you may follow it step by step.

    http://www.techbrothersit.com/2016/02/how-to-delete-all-files-in-folder.html

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.