all groups > sql server dts > september 2007 >
You're in the

sql server dts

group:

Modularization of Emails on Failure (DTS not SSIS)



Modularization of Emails on Failure (DTS not SSIS) tech101 NO[at]SPAM gmail.com
9/9/2007 7:12:27 AM
sql server dts: In a DTS package, it is a laborious task to connect an On Failure
Workflow to a different Send Mail Task for each task (major or minor).
I am trying to do some researching on a single effective way of
sending an email with a description of the error and the job->task
that it belonged to.

What I thought could be possible is to have an On Failure Workflow
coming from each of the tasks in a package pointing to an ActiveX
script that can gather the Job (if applicable), DTS Package and Task
name, error code, message and description, and the time of the error
and put it into a temporary global variable, then use that to make up
the subject and body in a Send Mail Task. Though I have never done
anything like this in DTS before.

The down point here is that there will be a very messy DTS diagram at
the end with all the candy red arrows pointing to the ActiveX task.
Slightly more agreeable than having a separate Send Mail task at the
end of each red arrow.

Is there a better way to do this?
Re: Modularization of Emails on Failure (DTS not SSIS) Jay
9/11/2007 10:16:36 PM
[quoted text, click to view]

I've taken a somewhat different approach to this problem. Due to the
nature of my group we have hundreds of etl type jobs that run
everyday. So I created a "job monitor" job that runs every hour and
reports the job names that have failed with an attached .csv file
containing the step that failed with a description. I did this with a
couple of stored procedures that query the msdb..sysjobs and
msdb..sysjobsteps. Take a look at those tables and I think you find a
solution that can be developed to cover all jobs rather than having
each package and job require all the extra work to report issues. If
you need more help let me know. Good luck.


Jay
Re: Modularization of Emails on Failure (DTS not SSIS) jhofmeyr NO[at]SPAM googlemail.com
9/12/2007 8:18:36 AM
[quoted text, click to view]

Hi Tech...,

Have you checked out the Event Handler functionality build in to SSIS?
You can create a set of tasks to execute when any OnError event occurs
(or different tasks at different stages of the package), and using the
System::PackageName, System::TaskName, System::ErrorCode and
System::ErrorDescription variables you should be able to access all
the required info to log your error (or email it :) )

Good Luck!
J
AddThis Social Bookmark Button