SSIS 发送错误邮件 [英] SSIS send mail for errors
本文介绍了SSIS 发送错误邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果包执行中出现任何错误,我如何发送包含错误详细信息的电子邮件?基本上如何获取错误详细信息并将它们放入发送邮件任务的消息中?
How can I send emails with error details if there is any error in package execution? Basically how can I get error details and put them in Message of Send mail task?
推荐答案
示例如下:
假设我有一个 sql 任务,我想收到关于任务失败"的电子邮件,其中包含错误描述.
Let's say i have one sql task , i want to get the email on "task failure" with the description of error .
- 现在拖动电子邮件任务并在失败时从 sql 任务到电子邮件任务给予先例约束.
- 在电子邮件任务中,提供 smtp 连接、发件人、收件人电子邮件地址、主题、消息 .. 等
- 为错误消息创建用户变量
- 为任务失败或出错设置事件处理程序,并在包级别创建脚本任务.
- 在脚本任务中..我们需要分配系统变量和用户变量.
- 确保属性 -- 禁用事件处理程序应该是假的,然后它才会读取系统变量.
最后执行包..如果发生任何错误,您将收到包含描述的电子邮件.
Finally execute the package .. if any error occurred then you will get the email with the description .
谢谢
R
这篇关于SSIS 发送错误邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文