Error handling and send mail task in batch script RRS feed

  • Question




    We currently have a  SSIS package which is using a batch script . This batch script actually executes on TERADATA server and loads data in to terdata db. We did not get access to UNIX env so we are planning to create SSIS packages that can call the batch scripts and perform tasks on terdata.


    Can somebody throw some light how to caputure the information if there is error in batch script or data loading and send a mail.


    Ealrier we created packages that were doing data loading on SQL server and if something fails then we used error handling machanism in stored procedures which logs failure event in to SQL table and then using send mail task it send a email.


    I nwant to know how  to use error handling when something fails on terdata and send mail to us.



    Tuesday, February 12, 2008 6:52 PM

All replies

  • Can you capture the output of the batch file and pharse the output file looking for error messages?

    Not elegent, but without access to UNIX.


    remmember to clear down the output file at the start of the job.

    Are there any holistic checks you can do at the end to 'prove' the update worked or failed?



    Tuesday, February 12, 2008 9:14 PM
  • Here's some additional information on capturing the output of a Execute Process task that is running a batch file: http://blogs.msdn.com/michen/archive/2007/08/02/redirecting-output-of-execute-process-task.aspx


    Wednesday, February 13, 2008 1:14 AM



    All I want to do is Use EXECUTE PROCESS TASK in SSIS which will call batch script located in some drive. This batch script has the file path location of macro that will be executed on Teradata.


    I couldn't find much info on EXECUTE PROCESS TASK online. Can someone explain me how to capture error if something fails in the Macro and then send mail using Send mail task.


    Thanks in advance

    Wednesday, February 13, 2008 4:33 AM
  • If the process returns a failure code, then the Execute Process task will fail. So you can use an Error precedence constraint between the Execute Process and the Send Mail.


    If the process returns success, but reports an error in the console output, you will have to follow the recommendations above - capture the output, and parse it to see if there was an error.


    Wednesday, February 13, 2008 2:11 PM