send notification error task level and package leve useing ssis script

  • hi friends i have small doubt in ssis

    how to send email noftification task level or package level errore useing ssis script task

    here i create logging sqlserver table and maintain errore message in that table and i want send what evere errore messag come in ssislog table that message to send superiore though useing script task.

    public void Main()

    {

    string EmailSender = "asrinu13@gmail.com";

    string EmailRecipient ="srinudw22@gmail.com";

    string EmailServer = "smtp.gmail.com";

    string EmailBody = "Email from radiance server";

    string Subject = "Email Testing";

    MailMessage myhtmlMessage = new MailMessage(EmailSender,EmailRecipient,Subject, EmailBody);

    SmtpClient mysmtpclient = new SmtpClient(EmailServer, 587);

    mysmtpclient.EnableSsl = true;

    System.Net.NetworkCredential crediantials = new System.Net.NetworkCredential(EmailSender, "balukumar");

    mysmtpclient.UseDefaultCredentials = false;

    mysmtpclient.Credentials = crediantials;

    mysmtpclient.Send(myhtmlMessage);

    Dts.TaskResult = (int)ScriptResults.Success;

    Dts.TaskResult = (int)ScriptResults.Success;

    }

    here i need to add ssislog table information code in the above script .

    please tell me how to write code to add ssislogtable meesage and send to superiores.

  • Is there a reason why you want to do this using a Script Task rather than creating an Event Handler and using the built-in Send Email Task?

    Robert Sheldon has written a good article on how to create an Event Handler - https://www.simple-talk.com/sql/ssis/ssis-event-handlers-basics/

    If you create an SSIS Package template that includes an Event Handler and then use that template as the basis for all your SSIS packages you'll get error handling 'for free' in your subsequent packages.

    If you are fixed on achieving your requirements using a Script Task, then this link may be of help: http://technet.microsoft.com/en-us/library/ms136054.aspx

    Regards

    Lempster

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

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