Capure Error in SSIS Package

Posted by Lakhangarg under Sql Server on 3/22/2010 | Views : 6223 | Status : [Member] [Moderator] | Replies : 4
Hi Everybody-

Can anybody tellm,e how to capure error and send the description in a email.
I have added the script task in OnError event handler and get the error message from System::ErrorDescription into a global variable and then send that message in a mail in OnPostExecute Event. My problem here is that OnPostExecute Event execute number of time. but i want it to eecute it once at the end of package execution. Right now i am using one varible to check if it is first time then send email otherwise quit. in this case it send only the first error.

Thanks
Lakhan Pal Garg




Responses

Posted by: Vuyiswamb on: 3/24/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
How do you execute the package. if you execute the package programatically then see how i do it here
http://www.dotnetfunda.com/articles/article795-how-to-execute-ssis-packages-in-csharp-aspnet-part-ii-.aspx

and if you do it with a SQL Job if there are errors , there is an option the settings of a Job to allow you to send an e-mail


Thank you for posting at Dotnetfunda
[Administrator]

Lakhangarg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakhangarg on: 3/24/2010 [Member] [Moderator] Silver

Up
0
Down
Hi Vuyiswamb-

Let us suppose i want to manually execute a package instead of code and of job scheduler. and want to use SSIS's events to capure error and send Email at the end of execution. then how can we do this?

Thanks
Lakhan Pal Garg

Lakhangarg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 3/24/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Do you want to trap errors inside SSIS ?

http://msdn.microsoft.com/en-us/library/ms141679.aspx

in my case i run the package programmatically and have a function that will send the e-mail and accept the error description of the package. The SSIS has a

Thank you for posting at Dotnetfunda
[Administrator]

Lakhangarg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakhangarg on: 3/24/2010 [Member] [Moderator] Silver

Up
0
Down
Hi -

I am not looking for the solution to handle error with precedence constraint at indvidual task level. I am looking for solution to handle error at the package level. like onError Event , onPostExecute event etc..

Thanks
Lakhan Pal Garg

Lakhangarg, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response