SSIS OnError or OnTaskFailed events not getting raised
Hi, I have an SSIS package that Imports Data from Access Database into SQL Server. I copy data from multiple tables over couple of mdbs. I have several Dataflow Tasks and each of them copy data from an access table to SQL Server table. I have all that in
a sequence container and from the sequence container I have a Send Email task connected via an Expression constraint, that will send the email out if it encounters any errors.
Now for some task the onError gets raised, but for some (eg an access table having Invalid date) does not raise onError event. The task copies data till it encounters the faulting record and stops, but does not raise onError. Neither is the OnTaskFailed
event getting raised. I wonder why.
I have a script task attached to both the events, which log the error messages and that gets emailed out when the task fails.
Any help will be greatly appreciated. I can't think of what's wrong.
Thanks
June 14th, 2011 11:40am
Are you executing the entire package or some tasks or containers in the package? You need to execute the entire package.My Blog | Ask Me |
Test your SSIS skills
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2011 12:14pm
When I execute the entire package, it kind of hangs on that particular Data Flow Task. So I just clicked on the Data Flow Task and tried to execute it. That shows the error(red), but does not raise any event. I wonder why?
So I created a test package with just that Data Flow Task and executed the package as well. That also errors out but no events raised. I changed the property of the Data Flow Task to FailPackageonFailure set to True.. but no luck..
What could be wrong??????
Please help!!!
Thanks
June 14th, 2011 1:41pm
If you just execute a part task or a seq container just that part runs, remember the events also have tasks in them so you need to run the entire package for the tasks in there to run.
Coming to you issue of when you move the dft to another package still your error evet is not getting fired. when you say that too errors, do you see the dft go red? or any specific transform in the DFT fail? Have you configured the onError event for the
new package? My Blog | Ask Me |
Test your SSIS skills
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2011 2:41pm
Yes I see the DFT go red. It fails when trying to load a date field which is not right in the .mdb.
Hmm.. I didn't configure the onError event for the new package. I just configured the events for the DFT. Do I have to do it at the package level as well? Please advise.
Thanks
June 14th, 2011 3:27pm
Yes I see the DFT go red. It fails when trying to load a date field which is not right in the .mdb.
Hmm.. I didn't configure the onError event for the new package. I just configured the events for the DFT. Do I have to do it at the package level as well? Please advise.
Thanks
Here's the script that should run onError event:
Public Class ScriptMain
Dim messages as Collections.ArrayList
Public Sub Main()
Try
messages = CType(Dts.Variables("errorMessages").Value, Collections.ArrayList)
Catch Ex as Exception
messages = New Collections.ArrayList
End Try
messages.Add(Dts.Variables("ErrorDescription").Value.ToString())
Dts.Variables("errorMessages").Value = messages
Dts.Variables("errorCount").Value = messages.Count
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2011 3:28pm
Is the DisableEventHandlers property set to true on any of these tasks that it is not firing on?
June 15th, 2011 12:10am
No the DisableEventHandlers is set to False for all the DFT...Any ideas...
Free Windows Admin Tool Kit Click here and download it now
June 15th, 2011 11:15am
Are the data flow components set to fail the package on error?
June 22nd, 2011 1:19am