检索 ssis 中的错误消息
有没有办法获取包的“执行结果”选项卡中显示的错误消息的字符串变量。??? 请帮忙。!
Is there any way to get a string variable of error message shown in Execution result tab of a package.???
Please help.!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您正在寻找一种记录信息/警告/错误消息的方法,那么您可以使用 SSIS 日志记录功能。
请参考我的答案 此 Stack Overflow 问题,了解如何配置日志记录功能。
SSIS 日志记录将捕获“执行结果”选项卡中显示的所有消息。您还可以将其配置为记录您感兴趣的消息。
希望有所帮助。
If you are looking for a way to log the information/warning/error messages then you can make use of SSIS logging feature.
Please refer my answer in this Stack Overflow question to understand how to configure the logging feature.
SSIS logging will capture all the messages that are shown in the
Execution Results
tab. You can also configure it to log the messages that you are interested in.Hope that helps.
尽管这个问题已经得到解答,但我想对所提出的问题添加几点。
有没有办法获取包的“执行结果”选项卡中显示的错误消息的字符串变量。
假设您在 SSIS 包中遇到错误,现在我们需要将该错误记录到您自己的表中(SSIS 目录数据库除外),您可以使用参数化的 INSERT 脚本创建执行 SQL 任务。您需要在参数映射选项卡中使用的参数是System::ErrorDescription。
INSERT INTO LOG_TABLE(ID,ERROR,ERROR_TIMESTAMP) VALUES(1,?,GETDATE());
注意:您可以利用其他系统变量(例如 PackageName、MachineName 等)来登录该表。
请参考下面的屏幕截图:
Though this question has already answered i would like to add few points to the question being asked.
Is there any way to get a string variable of error message shown in Execution result tab of a package.
Assume you encountered an error in your SSIS package, now all we need to log that error into your own table (other than SSIS catalog DB's), you can create a Execute SQL task with the INSERT script parameterized. Paramerter you need to use in Parameter Mapping tab is System::ErrorDescription.
INSERT INTO LOG_TABLE(ID,ERROR,ERROR_TIMESTAMP) VALUES(1,?,GETDATE());
Note: You can utilize other System Variables like PackageName,MachineName etc to log into the table.
Please refer screenshot below: