Imitating workflow in DTS

  • We have a DTS which imports an excel file. Some days the excel file is not there and we get an error. We don't want that to happen, however we do want an error if something actually goes wrong.

    My first thought was to create another, initial, step which checks for the existence of the file and reports success if it is there and failure if not. Then I would change the failure action of the step to 'quit job reporting success'. But what if something goes wrong in the code....I don't know what would...perhaps an incorrect file name or something - we'd be reporting success and oblivious to it.

    Anyone have a solution to this?

  • I have this same situation. I have the step that checks for file existence go to the last step if the file isn't found. That step sends the DBAs an email, using xp_sendmail, that tells us that the file wasn't there. It looks something like this:

    step 1: check for file existence - if file exists, step succeeds and goes to next step; if file doesn't

    exist, fail the step and go to step 3

    step 2: execute the DTS package

    step 3: send email saying file wasn't found

    So, if the file isn't found, the job doesn't even attempt to execute the package.

    Greg

    Greg

  • sam,

    If you want to do this all in DTS then you will need an ActiveX task that checks for the file. If it does not find the the file then it would disable then following step (and so exit the DTS package without reporting an error). If if finds the file then it should enable the following step (and so import the file and do whatever you want to do).

    Jez

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply