Home Forums Data Warehousing Integration Services way to get just the latest file from stft site without scripting or creation of a sql table for parsing filenames? RE: way to get just the latest file from stft site without scripting or creation of a sql table for parsing filenames?

  • One way might be to read the names of all the files in the directory into a variable one at a time, then parse off the date into a date variable. Then compare to the next file's date (that you strip out). Since you wouild only have @CurrentFileDate and @LatestDate as variables, you could compare the two easily. You'd have to create some variables to hold the currentFileName, the LatestFileDate, and the FileName for the file with the LatestFileDate. Then you could just loop through the directory, read the file names, split off the date, do the the comparisons. At the end, you'll have the file with the latest date. Then just use that in your transfer.