OK. Here's my situation. I check for the existence of a dummy .txt file using a script. I send an e-mail if it does not exist and exit package. The .txt file only exists if another .xls file is present which I import. However, during the validation phase of the package, the package fails because the .xls file does not exist. Is there a way to bypass the validation step? The only solution I came up with is to have a two-step job. The first runs the file check step and sends the e-mail. The second attemps to run the package and fails. Not a very graceful exit.
In your package, make the first task a script task that checks to see if the file exists. If it does, set a package variable to indicate that it does exist. Connect that script task to the data flow task with a Success constraint. Double-click the constraint and add an expression that evaluates to True if the variable indicates that the file exists. On your data flow task, set the DelayValidation property to True.
Let me know if you need additional details.
|||Thanks for the quick response. I actually didn't use a variable, just some control flow controls to send an e-mail if the first file doesn't exist; I'll try to integrate your suggestion on setting the variables in the future. The trick for me was the delay validation flag on the data flow. Thanks again.
No comments:
Post a Comment