在 SSIS 中重用任务

发布于 2024-09-17 19:16:45 字数 148 浏览 5 评论 0原文

如何在不复制/粘贴的情况下在 SSIS 中重用任务?

例如,我想使用我在事件处理程序中为另一个可执行文件中的一个可执行文件定义的任务,但不使用包中的所有可执行文件。到目前为止,除了编写完整的自定义组件之外,我还没有找到任何解决方案,这似乎有点矫枉过正。有什么建议吗?

How can a task be reused in SSIS without copy/paste?

For example, I'd like to use the tasks I've defined in an event handler for one executable in another executable, but not with all executables in the package. So far, I haven't found any solutions other than writing a complete custom component, which seems like overkill. Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

幸福还没到 2024-09-24 19:16:45

您是否考虑过在包级别使用事件,并进行过滤以仅在特定条件需要时触发?
例如,您可以使用 OnPostExecute 事件,只需在流程中放置一个虚拟任务,其名称以特定字符串(如“RunMyTasks”)开头,然后检查 System::SourceName 以查看它是否以“RunMyTasks”开头。如果是这样,则分支以运行您的任务(否则分支以像平常一样处理该事件)。

您可以使用 OnVariableValueChanged 执行类似的操作 - 这可能会更好(尽管您需要测试它)。创建一个 RaiseChangedEvent=TRUE 的变量。创建脚本任务/组件来更改变量的值;最后,将您的任务集放入事件处理程序中。
检查 Jamie 帖子底部的范围说明 在这里

Have you considered using an event at the package level, and filtering to only fire when your particular condition requires it?
E.g. you could use the OnPostExecute event just by putting a dummy task in your flow with a name that starts with a specific string like "RunMyTasks", and then check the System::SourceName to see if it starts with "RunMyTasks". If it does, then branch to run your tasks (and otherwise branch to handle the event as you normally would).

You could do a similar thing using OnVariableValueChanged - this might be better (although you'd need to test it). Create a variable with RaiseChangedEvent=TRUE. Create a script task / component to change the value of the variable; finally, put your task set into the event handler.
Check the scoping notes at the bottom of Jamie's post here.

夏尔 2024-09-24 19:16:45

如果您可以使用第三方解决方案,请检查商业 CozyRoc SSIS+ 库。它包括增强的 Script Task Plus,允许将脚本导出到外部文件,然后在其他包中链接和重用。

If you can use third-party solutions, check the commercial CozyRoc SSIS+ library. It includes enhanced Script Task Plus, which allows export of script to external file and then link and reuse in other packages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文