dbTalk Databases Forums  

get error message from previous job step

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss get error message from previous job step in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dsvick@gmail.com
 
Posts: n/a

Default get error message from previous job step - 03-16-2006 , 05:51 PM






Hi everyone:

I've a question that I can't seem to find an answer on so I figured I'd
see if it can even be done.

We have several DTS packages that are run on schedule through several
jobs. Is there a way in job step to get the error message from a
previous job step that failed short of querying the job history table?

The reason I ask is that we have a SQL Server running on a machine and
SQL Mail is not running on it so I can't use the automated
notifications built into the job steps. I have a stored procedure that
will let me send an email via SMTP and would like to have any failed
steps in a job go to the last step that executes the stored procedure
to send the email. What I need is to be able to get the error message
that caused the failure.

The only other way I can think of doing this is to write the steps to a
log file then email the log file as an attachment.

One other possibilty would be to use an alert that is triggered when a
job fails, that way I could having to add a step to all of the jobs.
The alert could then run a job but the problem remains of trying to
determine the reason for the error.

Any help, input, or other suggestions would be greatly appreciated.


Reply With Quote
  #2  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: get error message from previous job step - 03-16-2006 , 08:38 PM






Another option is to use an output file for your job steps.
When the set fails and executes the smtp step, attach a copy
of the output file to the email.

-Sue

On 16 Mar 2006 15:51:29 -0800, dsvick (AT) gmail (DOT) com wrote:

Quote:
Hi everyone:

I've a question that I can't seem to find an answer on so I figured I'd
see if it can even be done.

We have several DTS packages that are run on schedule through several
jobs. Is there a way in job step to get the error message from a
previous job step that failed short of querying the job history table?

The reason I ask is that we have a SQL Server running on a machine and
SQL Mail is not running on it so I can't use the automated
notifications built into the job steps. I have a stored procedure that
will let me send an email via SMTP and would like to have any failed
steps in a job go to the last step that executes the stored procedure
to send the email. What I need is to be able to get the error message
that caused the failure.

The only other way I can think of doing this is to write the steps to a
log file then email the log file as an attachment.

One other possibilty would be to use an alert that is triggered when a
job fails, that way I could having to add a step to all of the jobs.
The alert could then run a job but the problem remains of trying to
determine the reason for the error.

Any help, input, or other suggestions would be greatly appreciated.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.