Wednesday, March 21, 2012

dts package to check dynamic file name

Hi all,

I have created a DTS package in SQL Server that uses file system obj to list the .csv files in a folder then runs and imports it into database. The problem that I run into is - the names of the .csv files will be dynamic based on the date and at times the hour.

The question is how to check ( I believe using Active X) for a new file each day and even each hour?

A sample of what my file names are:

CVG_IDO_1_20070703.csv

CVG_IDO_2_20070703.csv

CVG_IDO_3_20070703.csv

CVG_IDO_1_20070704.csv

CVG_IDO_2_20070704.csv

CVG_IDO_3_20070704.csv

Thank you!

A bit hard to say...what constitutes a new file? Are you trying to process all files in the directory? Are those all considered "new files"?

The following article on sqldts.com may help you out, depending on what your needs are with this:

Looping, Importing, and Archiving - http://www.sqldts.com/246.aspx

-Sue

|||

i believe this is time triggered. the last part of the filename is obvoiusly the date

prior to that is a number followed by an underscore.

if this number designate the latest file then you can easily script it.

well that is if your only going to pull out the latest file.

No comments:

Post a Comment