SSIS——允许任务失败但包成功?

编程入门 行业动态 更新时间:2024-10-28 21:31:10
本文介绍了SSIS——允许任务失败但包成功?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有没有办法允许脚本任务失败,而包执行结果只基于其他任务的执行结果?例如,我有 5 个任务.我不在乎任务 2 的结果是什么,但是如果其他任务中的任何一个失败,我希望包失败.否则,我希望它成功...

Is there a way to allow a script task to fail, yet have the package execution result based only on the other tasks' execution results? For example, I have 5 tasks. I don't care what task 2's result is, but if any of the others fail, I want the package to fail. Otherwise, I want it to succeed...

这可能吗?

推荐答案

尝试在任务的属性中将 FailPackageOnFailure 设置为 False.

Try setting FailPackageOnFailure to False in the Task's Properties.

下一个选项实际上不会使您的任务失败,但可能对您有用:尝试将您的代码包装到 try catch 中,并使用 finally 为您不关心的 2 个任务设置 Success.

Next option will not actually fail your tasks, but may work for you: Try wrapping your code into try catch and use finally to set Success for 2 tasks that you don't care about.

try { // Do work here } catch { // log errors here } finally { Dts.TaskResult = (int)ScriptResults.Success; }

更多推荐

SSIS——允许任务失败但包成功?

本文发布于:2023-11-24 08:19:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624450.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SSIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!