如果作业失败,则发送电子邮件ssis错误代码 [英] email ssis error code if job fails at step

查看:171
本文介绍了如果作业失败,则发送电子邮件ssis错误代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



当作业失败时,有没有办法通过电子邮件发送错误代码?无论错误代码被抛出,我都希望邮寄错误通知。这可以通过电子邮件从作业历史中获取相同的错误描述和代码吗?



谢谢。

Hi All,

Is there any way to email the error code from ssis when the job fails? whatever error code gets thrown out I want to have it mailed for error notification. Is this possible to get the same error description and code from the job history via email?

thanks.

推荐答案

ssis-send-mail-for-errors [ ^ ]



Let-ssis-notify-of-its-own-errors.html [ ^ ]






是的,可以通过SSIS包中的电子邮件发送完整的错误详细信息,您可以使用包级错误处理程序并放置脚本任务,以便在packa发生任何错误时发送电子邮件任何任务中的ge级别。



您需要使用任务中的错误详细信息设置包级别变量,然后在脚本任务中使用此变量来发送电子邮件。您需要在此处编写C#代码以使用SMTP服务器发送电子邮件从变量中设置电子邮件正文中的错误详细信息,



您还可以使用系统,还可以使用系统变量作为脚本任务的输入(例如system :: errorcode,system:errordescription),其中包含与错误相关的信息,并在电子邮件正文中使用此varibale详细信息,然后发送电子邮件。





如果您需要其他详细信息,请告知我们。



问候,

Mubin
Hi,

Yes it is possible to send complete error detail via email from SSIS package, you can use package level error handler and place script task withing it to send email whenever any error occur at package level in any task.

You need to set Package level variable with your error detail from your task, and then use this variable in your Script task to send email. You need to write C# code here to send email using SMTP server set your error detail in email body from variable,

Onemore thing you can do, you can also utilize system varaibles as input to your script task( e.g. system::errorcode,system:errordescription) , which holds information related to error and use this varibale detail in email message body and then send email.


let me know if you need anyother detail.

Regards,
Mubin


这篇关于如果作业失败,则发送电子邮件ssis错误代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆