Sending Emails with SSIS however have a Script Task Error

  • HI, Hope there is someone out there that can help me. I have a package which enables me to take a designed SSRS report and dynamically send the report depending on a sql table. As not always will I know who to send the report too as it is driven by errors recorded in the system by a group of users, so any one can make an mistake and I am just letting them know to fix it. The script tutorial I am using is in the link:-

    [/url]

    So I have completed this process on SQL 2012 and SSIS/SSRS 2012 and works fine. I have now re-created it from scratch on a SQL 2008 machine as this is where it will reside. I now get a horrible vague error.

    "Task failed: Script Task - Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "Package.dtsx" finished: Failure. The program '[280] Package.dtsx: DTS' has exited with code 0 (0x0)."

    Now I have increased the error count to a 1,000 which I saw on another blog, but still the error comes back and I think it is not related to the script task. The other horrible thing is the lack of control on the Send Email Task as it is not great with a SMTP auth, but I think I have a way round that.

    So any ideas welcomed and I am really in need of fixing this quickly.

    Many thanks a dedicated SSC fan

  • Put your code inside the script task into a try catch.

    Inside the catch blog, log the error message.

    Logging in the Script Task

    Make sure you enable the ScriptTaskLogEntry event in the SSIS logging for the Script Task.

    This will enable you to log the actual error message so you can troubleshoot.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • HI Keon. Thank you for coming back so quick on this reponse

    I have put the logging on the SSIS and the following has been returned. I have changed the error count on the loop back from 1000 to 1, to see if that is masking the problem. However I am not sure this list tells me much more:-

    OnError,Servername\rtuson,Script Task,{49ED9923-33B0-45E9-ABC4-4DBB7B95DE9A},{8326C079-0E33-4D0A-97FC-A624BCBDF776},6/06/2014 4:32:40 PM,6/06/2014 4:32:40 PM,8,0x,The script returned a failure result.

    OnError, Servername\rtuson,Script Task,Foreach Loop Container,{61B15359-6793-41C2-AA76-233A9CF026F6},{8326C079-0E33-4D0A-97FC-A624BCBDF776},6/06/2014 4:32:40 PM,6/06/2014 4:32:40 PM,8,0x,The script returned a failure result.

    OnError, Servername\rtuson,Script Task,Package,{C29411FB-EABA-48EF-B1E5-4E6379C84DEA},{8326C079-0E33-4D0A-97FC-A624BCBDF776},6/06/2014 4:32:40 PM,6/06/2014 4:32:40 PM,8,0x,The script returned a failure result.

    PackageEnd, Servername\rtuson,Script Task,Package,{C29411FB-EABA-48EF-B1E5-4E6379C84DEA},{8326C079-0E33-4D0A-97FC-A624BCBDF776},6/06/2014 4:32:40 PM,6/06/2014 4:32:40 PM,1,0x,End of package execution.

    Any help on this would be welcomed

    Regards

  • Did you enable the event ScriptTaskLogEntry in the SSIS log details tab for the script task?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Is this a run-time error or a validation error?

    When you recreated the package in 2008, did you do it from scratch, or did you try to reuse/copy/whatever bits of your 2012 package? In particular, the code in the script task.

    If it's a run-time error, you should be able to set a breakpoint in the script task to find out which line is bombing out.


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

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