0

I need to load the data from the latest file to SQL Server, I have to handle this in the SSIS using C# script. I am not good in C# scripting. We are using 2010 version.

ACCOUNT_20170703_030505.txt
ACCOUNT_20170703_022510.txt
ACCOUNT_20170703_060015.txt

Can you kindly help me how to fetch the latest file name in script and pass to SSIS.

Thanks in advance.

Prabhat G
  • 2,974
  • 1
  • 22
  • 31
Mohan
  • 21
  • 1
  • Could you please add more information, maybe code or screen shoot will help to improve the question and people will help you, thanks in advance. – Stornu2 Jul 03 '17 at 12:28
  • Sounds like you need a [tutorial](https://www.simple-talk.com/sql/ssis/ssis-basics-introducing-the-foreach-loop-container/) rather than an answer, which is [off-topic](https://stackoverflow.com/help/on-topic). – David Rushton Jul 03 '17 at 12:52
  • 1
    I think your query can be resolved by solution provided in below article link: [https://stackoverflow.com/questions/8831060/import-most-recent-csv-file-to-sql-server-in-ssis](https://stackoverflow.com/questions/8831060/import-most-recent-csv-file-to-sql-server-in-ssis) – Hiral Jul 04 '17 at 04:54
  • I have different set files in the folder like below, ACCOUNT_20170703_030505.txt ACCOUNT_20170703_022510.txt ACCOUNT_20170703_060015.txt BANK_20160502_030441.txt CHECK_20170215_091000.txt ..... I want to read the latest file of the ACCOUNT and load into the DB. I mean the file ACCOUNT_20170703_060015.txt is the latest because it created on 3rd July 2017 6 AM . So I want to get this filename dynamic by checking the file name in SSIS using SCRIPT TASK (using C# coding). Is it possible. – Mohan Jul 05 '17 at 11:32

0 Answers0