7

Is there a way to allow a script task to fail, yet have the package execution result based only on the other tasks' execution results? For example, I have 5 tasks. I don't care what task 2's result is, but if any of the others fail, I want the package to fail. Otherwise, I want it to succeed...

This possible?

nosirrahcd
  • 1,467
  • 3
  • 18
  • 36

2 Answers2

5

As well as setting FailPackageOnFailure on the task you should also set MaximumErrorCount on the package itself to something greater than 1. The task will still increment the packages error count and if the error count exceeds MaximumErrorCount then the package can/will still fail.

squillman
  • 13,363
  • 3
  • 41
  • 60
4

Try setting FailPackageOnFailure to False in the Task's Properties.

Next option will not actually fail your tasks, but may work for you: Try wrapping your code into try catch and use finally to set Success for 2 tasks that you don't care about.

        try
        {
           // Do work here 
        }
        catch
        {
            // log errors here
        }
        finally
        {
            Dts.TaskResult = (int)ScriptResults.Success;
        }
Ilya Berdichevsky
  • 1,249
  • 10
  • 24
  • Unfortunately, for several reasons, the task has to fail sometimes. – nosirrahcd Jan 10 '11 at 16:51
  • This post have a link to a solution using EventHandlers: http://stackoverflow.com/questions/140850/the-best-way-for-a-ssis-ftp-task-to-not-fail-when-there-are-no-files-to-copy/306273#306273 – Ilya Berdichevsky Jan 12 '11 at 15:56