Problem with having mutiple script tasks in an SSIS Package

  • I have a package with 3 control flow tasks all enclosed in a sequence container. For each of these taks I have added a script flow task in the "OnError" event handler. I am trapping the error in a variable.

    To the sequence container I have added a script task which takes the value from this variable and sends an email.

    However the error message I receive is repeated 3 times even though only one of the tasks has the error. Is it because all the script tasks have the entry point as "ScriptMain".

    Can we have mutiple script tasks with the same entry point? Please advice how to proceed.

  • Joseph,

    I'm sorry, I'm having trouble visualizing what you are describing. Could you post a screen print of the package? I think that will be enough..

    CEWII

  • We need to understand a bit more about the logical flow of your package, I think.

    You can easily check out your Script Main suspicion - just try changing it to be unique (and changing the entry point).

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • The attached doc file shows the layout. This contains 2 SQL Exceute tasks. For each of these tasks the on error event contains a Script task to collect the error and place in a variable.

    The Collect All Errors (Script task) collects the errors and sends an email. In this situation the error is repeated twice.

    I have even changed the Class Name in the script tasks, to something other than ScriptMain, and also the entry points but I still get the message repeated.

  • Surely your e-mail task needs to be outside of the Sequence container, after the Collect All Errors task?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • The email is outside the sequence container. The script task "Collect All Errors' collects all the errors and sends the email

  • Ok, I have a better idea..

    Every script task is effectively its own "class" there shouldn't be any issue with each having its own ScriptMain..

    So I don't think that is your problem...

    CEWII

  • So what do Email_Start and Email_Success do?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • The Email Start just sends an email that the package has started and the Email Success sends an email if the job completed successfully

  • Have you tried debugging the Script Task to see whether that gives you any clues about what is happening?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Yes I have tried. I have placed break points in the script tasks which fire onerror for the Tasks "Get Previous Run Dates" and "Update SSIS Last run table", but these are ignored by the package. Only Break points in the "Collect All Errors" work. At present I an trying to check this.

  • I recreated all the script tasks (previously I had created one and then copied it over) but still find the same problem. Breakpoints set in the script tasks for the onerror message are ignored by the package when it runs.

    Finally I have put in code to remove the duplicate error messages before sending the email.

    If anyone comes up with a reason for this behavior please let me know

Viewing 12 posts - 1 through 11 (of 11 total)

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