download latest files from winscp(SFTP) in ssis

Roopa Tata 20 Reputation points
2023-07-19T06:36:13.8233333+00:00

I need some help to identify the Latest file from multiple files with different data time stamp like below in winscp(SFTP). I want to download those latest files to my local folder using execute process task in ssis.

  1. Timetravel_13-07-2023_06-30-00.csv
  2. Timetravel_12-07-2023_18-30-00.csv
  3. Orgs_13-07-2023_06-30-05.csv
  4. Allop_13-07-2023_06-30-00.csv
  5. Allop_11-07-2023_18-30-01.csv

I want 3 below files from above list like

Timetravel_13-07-2023_06-30-00.csv

Orgs_13-07-2023_06-30-05.csv

Allop_13-07-2023_06-30-00.csv

Could some one help on this will be gr8 help.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,706 questions
SQL Server | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 41,496 Reputation points
    2023-07-19T08:35:23.9666667+00:00

    Hi @Roopa Tata,

    You may download all the files from winscp(SFTP) first and then use C# to get the latest files.

    Check: https://bageshkumarbagi-msbi.blogspot.com/2019/09/load-latest-file-into-database-using.html

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


  2. Yitzhak Khabinsky 26,586 Reputation points
    2023-07-19T12:22:28.4966667+00:00

    Hi @Roopa Tata,

    WinSCP provides an excellent support for SSIS.

    Check it out here, directly on the WinSCP site:

    0 comments No comments

Your answer

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