SSIS:您如何在另一个包的脚本组件中重用脚本? [英] SSIS: How do you reuse script in a scripting component in another Package?

查看:22
本文介绍了SSIS:您如何在另一个包的脚本组件中重用脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的...我有我的第一个使用脚本对象的 SSIS 包.我单击脚本"按钮并在 Visual Studio for Applications IDE 中编写了一个过程.

OK...I have my first SSIS package that uses a Scripting object. I clicked the Script button and wrote a procedure in the Visual Studio for Applications IDE.

现在我想在另一个包中重用这段代码.

Now I want to reuse this code in another package.

避免 Control+C、Control V 的最佳做法是什么?

What is the best practice to avoid Control+C, Control V?

推荐答案

在重用 Control Flow 工具箱中的 Script Task 时引用 MSDN.这是 MSDN 的链接.

Quoting MSDN on reusing Script Task that is present in Control Flow toolbox. Here is the link to MSDN.

如果多个包使用脚本,请考虑编写自定义任务而不是使用脚本任务.有关详细信息,请参阅开发自定义任务.

If more than one package uses a script, consider writing a custom task instead of using the Script task. For more information, see Developing a Custom Task.

在重用 Data Flow Task 中存在的 脚本组件 时引用 MSDN.这是 MSDN 的链接.

Quoting MSDN on reusing Script Component that is present within Data Flow Task. Here is the link to MSDN.

脚本组件提供了一种在数据流中包含自定义函数的简单快捷的方法.但是,如果您计划在多个包中重复使用脚本代码,则应考虑编写自定义组件而不是使用脚本组件.有关详细信息,请参阅开发自定义数据流组件.

The Script component provides an easy and quick way to include custom functions in a data flow. However, if you plan to reuse the script code in multiple packages, you should consider programming a custom component instead of using the Script component. For more information, see Developing a Custom Data Flow Component.

您可以考虑的其他替代方案是:

  1. 使用可重用逻辑创建 .NET 库并在 GAC 中注册 DLL.在 GAC 中注册后,您可以在 Script Task 或 Script Component 中引用该库.这是一个链接,描述了这个.

  1. Create a .NET library with the reusable logic and register the DLL in GAC. Once it is registered in GAC, you can reference the library in Script Task or Script Component. Here is a link that describes about this.

您还可以查看第三方组件 Script Task PlusScript Component Plus 由 CozyRoc 开发.

You can also have a look at the third-party components Script Task Plus and Script Component Plus developed by CozyRoc.

希望有所帮助.

这篇关于SSIS:您如何在另一个包的脚本组件中重用脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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