Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

send notification error task level and package leve useing ssis script Expand / Collapse
Posted Tuesday, December 17, 2013 4:29 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, April 22, 2016 3:21 AM
Points: 216, Visits: 4,717
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 = "";
string EmailRecipient ="";
string EmailServer = "";

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;


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.

Post #1523603
Posted Wednesday, December 18, 2013 8:52 AM


Group: General Forum Members
Last Login: Wednesday, January 27, 2016 7:06 AM
Points: 2,657, Visits: 1,657
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 -

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:

Post #1524187
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse