SQL 2005 SSIS - check the status of a text file before processing
Creating an SSIS (SQL 2005) project, a text file is being copied to a specific directory by another process, I want to create an SSIS package that will then copy this file to another location for processing开发者_如何学运维 into a database. Problem...how do I check the status of this file to ensure that it has finished being copied to the directory so that I can copy it elsewhere?
Thanks,
Derek
We usually have the first process create a flag file (and empty text file with an .flg suffix) after it finishes copying the large file. So your process checks for the presence of the flag file.
One reason why it is good to have the flg file from the organization sending the file, is that they consider it to be finished. Without it we have loaded a file that was somehow stopped before it was finished on their end and eliminated half their sales force from access to our site. This is NOT a good thing.
Another use of flag files that we do with some customers is that they put the number of records in it that the main file should have, now we can check to make sure the main file actually has that number of records or stop the process.
Just a thought : you can try File Modified time properties. Compare the last modified time after some interval if it is same than file ready to use.
精彩评论