I would like to capture errors from an Execute SQL Task (a Stored Procedure). I have a step caled sendmail_failure which is:
Declare @Msg VarChar(32)
Declare @Sub VarChar(32)
Set @Sub = 'DTS Package Failure' + ' ' + Cast(GetDate()as VarChar)
execute master.. xp_sendmail @Recipients = 'myemail@address',
@subject = @Sub,
@message = 'Sproc_DataMerge: Update Failure'
What I'm hoping to do is send any error information in the message body portion of the mail. Since the job runs at 3am I want to do as little searching for the problem as possible. Can this be done? Thank you.
Declare @Msg VarChar(32)
Declare @Sub VarChar(32)
Set @Sub = 'DTS Package Failure' + ' ' + Cast(GetDate()as VarChar)
execute master.. xp_sendmail @Recipients = 'myemail@address',
@subject = @Sub,
@message = 'Sproc_DataMerge: Update Failure'
What I'm hoping to do is send any error information in the message body portion of the mail. Since the job runs at 3am I want to do as little searching for the problem as possible. Can this be done? Thank you.