SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


send notification error task level and package leve useing ssis script


send notification error task level and package leve useing ssis script

Author
Message
asranantha
asranantha
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1068 Visits: 4717
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.
Lempster
Lempster
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5226 Visits: 1657
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search