Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Unanswered: fail an execute sql task

    I have a dts package that is essentially three transformation tasks that creates 3 text files. The transform data is accomplished through an sql query. Before I execute the transform tasks I would like to peform a couple of simple existence checks to verify data: i.e,

    if exists (select * from table where week_ending = endoflastweek(getdate())

    I could put the statement into the sql (if exists, begin/end) of each of the transformation tasks and prevent the process from executing, but it would be easier to put it into an "execute sql task" and if it succeeds, fail the task or make some kind of declaration not to proceed. I'm not sure how to do this...I know this can be done with an activeX script,

    Main = DTSTaskExecResult_Failure

    Is there a way to do this in an execute sql task step?

  2. #2
    Join Date
    Jan 2003
    Provided Answers: 17
    I am not sure if you are looking for raiserror or return here. Look up both in Books Online, and see what you think. I am leaning raiserror.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts