使用 EzApi 创建 SSIS 包

发布于 2024-10-11 18:36:57 字数 107 浏览 3 评论 0 原文

我正在使用 EzApi 创建 SSIS 包。但是,我无法创建具有多个源和单个目标的包。例如,两个 OLEDB 源和一个 OLEDB 目标。 我到底想知道的是如何使用 C# 代码添加合并转换。 请帮忙

I am using EzApi for creating a SSIS package. However I am unable to create a package having multiple sources and single destination. For example two OLEDB sources and a single OLEDB destination.
What exactly I want to know is how to add merge transformation using c# code.
Please help

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

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

发布评论

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

评论(3

乜一 2024-10-18 18:36:57

EzApi中有一个名为EzMerge的组件
如果您需要创建自定义数据流 - 您可以使用名为 EzDataFlowPackage 的基类:

class MyPackage: EzDataFlowPackage
{
        public EzOleDbSource src1;
        public EzOleDbSource src2;
        public EzMerge merge;
        public EzOleDbDest dest;
        public EzOleDbConnectionManager srcConnMgr1;
        public EzOleDbConnectionManager srcConnMgr2;
        public EzOleDbConnectionManager destConnMgr;


        public EzMyPackage() : base() 
        {
            srcConnMgr1 = new EzOleDbConnectionManager(this);
            srcConnMgr2 = new EzOleDbConnectionManager(this);
            src1 = new EzOleDbSource(DataFlow);
            src2 = new EzOleDbSource(DataFlow);
            dest mew EzOleDbDest(DataFlow);
            src1.Connection = srcConnMgr1;
            src2.Connection = srcConnMgr2;
            dest.Connection = destConnMgr;
            merge = new EzMerge(DataFlow);
            src1.AttachTo(merge);
            src2.AttachTo(merge);
            merge.AttachTo(dest);
        }

        public EzMyPackage(Package p) : base(p) { }

        public static implicit operator EzMyPackage(Package p) { return new EzMyPackage(p); }
}

我刚刚输入了此代码 - 因此它可能包含错误。至此,您的包装布局就准备好了。您可以简单地设置组件属性。

In EzApi there is a component called EzMerge
If you need to create a custom dataflow - you can use the base class called EzDataFlowPackage:

class MyPackage: EzDataFlowPackage
{
        public EzOleDbSource src1;
        public EzOleDbSource src2;
        public EzMerge merge;
        public EzOleDbDest dest;
        public EzOleDbConnectionManager srcConnMgr1;
        public EzOleDbConnectionManager srcConnMgr2;
        public EzOleDbConnectionManager destConnMgr;


        public EzMyPackage() : base() 
        {
            srcConnMgr1 = new EzOleDbConnectionManager(this);
            srcConnMgr2 = new EzOleDbConnectionManager(this);
            src1 = new EzOleDbSource(DataFlow);
            src2 = new EzOleDbSource(DataFlow);
            dest mew EzOleDbDest(DataFlow);
            src1.Connection = srcConnMgr1;
            src2.Connection = srcConnMgr2;
            dest.Connection = destConnMgr;
            merge = new EzMerge(DataFlow);
            src1.AttachTo(merge);
            src2.AttachTo(merge);
            merge.AttachTo(dest);
        }

        public EzMyPackage(Package p) : base(p) { }

        public static implicit operator EzMyPackage(Package p) { return new EzMyPackage(p); }
}

I just typed this code in - so it may contain errors. By after all this your package layout is ready. And you can simply set component properties.

枯寂 2024-10-18 18:36:57

我没有使用过 EzApi,但是在 BIDS (Visual Studio) 中,您需要有两个数据源、一个数据目标和一个“合并”组件来连接它:

如下所示:

alt text

编辑

关于装箱是程序性的。查看以下链接:

http://thinkerkk.blogspot。 com/2007/08/programmatically-creating-dataflow-with.html

查找注释后的代码 //create the Merge Transformation

//create the Merge Transformation
IDTSComponentMetaData90 merge = dataflow.ComponentMetaDataCollection.New();
merge.ComponentClassID = "DTSTransform.MergeJoin";
CManagedComponentWrapper mergeDesigntime = merge.Instantiate();
mergeDesigntime.ProvideComponentProperties();
merge.Name = "Merge Source1 and source2";
Console.WriteLine("merge created ");
merge.InputCollection[0].ExternalMetadataColumnCollection.IsUsed = false;
merge.InputCollection[0].HasSideEffects = false;
merge.InputCollection[1].ExternalMetadataColumnCollection.IsUsed = false;
merge.InputCollection[1].HasSideEffects = false;

//create path from source1 to merge
/*More code - see article*/

//create path from source2 to merge
/*More code - see article*/

以下链接对于创建 SSIS 包也可能有用以编程方式:

http://msdn.microsoft.com/en-us/library/ ms135946.aspx

http://blogs.msdn.com/b/mattm/archive/2008/12/30/samples-for-creating-ssis-packages-programmatically.aspx

I've not used EzApi, however in BIDS (Visual Studio) you need to have two data sources, one data destination, and a 'merge' component to connect it:

Like so:

alt text

EDIT

With regard to crating is progamatically. Check out the following link:

http://thinkerkk.blogspot.com/2007/08/programmatically-creating-dataflow-with.html

Look for the code after the comment //create the Merge Transformation

//create the Merge Transformation
IDTSComponentMetaData90 merge = dataflow.ComponentMetaDataCollection.New();
merge.ComponentClassID = "DTSTransform.MergeJoin";
CManagedComponentWrapper mergeDesigntime = merge.Instantiate();
mergeDesigntime.ProvideComponentProperties();
merge.Name = "Merge Source1 and source2";
Console.WriteLine("merge created ");
merge.InputCollection[0].ExternalMetadataColumnCollection.IsUsed = false;
merge.InputCollection[0].HasSideEffects = false;
merge.InputCollection[1].ExternalMetadataColumnCollection.IsUsed = false;
merge.InputCollection[1].HasSideEffects = false;

//create path from source1 to merge
/*More code - see article*/

//create path from source2 to merge
/*More code - see article*/

The following links may also be useful for creating SSIS packages programatically:

http://msdn.microsoft.com/en-us/library/ms135946.aspx

http://blogs.msdn.com/b/mattm/archive/2008/12/30/samples-for-creating-ssis-packages-programmatically.aspx

笑叹一世浮沉 2024-10-18 18:36:57

使用适用于 SQL Server 的 EzApi,可以使用 EzMerge,它与为 DataTools 设计时的 Merge 相同。查找不同版本的 SQL Server 的 SQL Server EzApi:

SQLServer2008 https://github.com/koureasstavros/SQLServer2008EzApi https://www.nuget.org/packages/EzApi2008
SQLServer2012 https://github.com/koureasstavros/SQLServer2012EzApi https://www.nuget.org/packages/EzApi2012
SQLServer2014 https://github.com/koureasstavros/SQLServer2014EzApi https://www.nuget.org/packages/EzApi2014
SQLServer2016 https://github.com/koureasstavros/SQLServer2016EzApi https://www.nuget.org/packages/EzApi2016
SQLServer2017 https://github.com/koureasstavros/SQLServer2017EzApi https://www.nuget.org/packages/EzApi2017
SQLServer2019 https://github.com/koureasstavros/SQLServer2019EzApi https://www.nuget.org/packages/EzApi2019
SQLServer2022 https://github.com/koureasstavros/SQLServer2022EzApi https://www.nuget.org/packages/EzApi2022

Using EzApi for SQL Server there is EzMerge which is the same control like Merge while designing for DataTools. Find SQL Server EzApi for different versions of SQL Servers:

SQLServer2008 https://github.com/koureasstavros/SQLServer2008EzApi https://www.nuget.org/packages/EzApi2008
SQLServer2012 https://github.com/koureasstavros/SQLServer2012EzApi https://www.nuget.org/packages/EzApi2012
SQLServer2014 https://github.com/koureasstavros/SQLServer2014EzApi https://www.nuget.org/packages/EzApi2014
SQLServer2016 https://github.com/koureasstavros/SQLServer2016EzApi https://www.nuget.org/packages/EzApi2016
SQLServer2017 https://github.com/koureasstavros/SQLServer2017EzApi https://www.nuget.org/packages/EzApi2017
SQLServer2019 https://github.com/koureasstavros/SQLServer2019EzApi https://www.nuget.org/packages/EzApi2019
SQLServer2022 https://github.com/koureasstavros/SQLServer2022EzApi https://www.nuget.org/packages/EzApi2022
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文