August 3, 2005 at 10:52 am
I work on a script, which will import data from a flat file. The file will be manually placed into a network directory each day. A scheduled job will trigger a DTS package and import data from this file. How can I run file checksum from a DTS package to make sure that this is not a duplicate file? Maybe there are some other ways of identifying a duplicate file, using SQL Server 2000?
Thanks,
a subscriber.
August 4, 2005 at 4:18 am
Take a look at the filesystem object. You can retrieve the date and time that the file was created or modified.
That way you can store this in a table and check the max from the table is not the same as the current.
Just use activex script in the package to accomplish. Search sqldts.com for filesystemobject. Some great, easy to follow examples.
August 4, 2005 at 3:57 pm
Would it be possible to use the data to verify duplicates? Is there a field (or several fields together) that could comprise a primary key?
An obvious solution, I know, but I bring it up because I work with a process where the import from a text file is manual. A while back, we had some problems with the import, causing some of the text to be imported but not all of it. After we fixed the problem, we were able to simply re-run all the imports - all the data that wasn't currently in the system got added, and the duplicates weren't imported, they just spit out a duplicate message along with the PK to a log file.
August 4, 2005 at 5:37 pm
Thank you for your replies. I would have to get myself familiar with "filesystemobject". I just know that some programming languages have the ability to create the file checksum, which uniquely identifies the file. It is a single parameter and you don't need to worry about parsing the file or about checking the file properties.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply