从BIML脚本自动生成SSIS包 [英] Automatically generate SSIS package from BIML script

查看:21
本文介绍了从BIML脚本自动生成SSIS包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

完成 BIML 脚本(使用 BIDS SQL Server 2008)创建 SSIS 包后,您只需右键单击 BIML 文件并单击生成 SSIS 包.

Once you have finished your BIML script (using BIDS SQL Server 2008) to create the SSIS package you simply right click the BIML file and click Generate SSIS packages.

我如何通过代码生成 SSIS 包,例如C# 还是 SQL?我可以想象 BimlEngine.dll 的某种 shell 脚本,例如BimlEngine.dll -"myFileServermyBimlScript", "生成SSIS包"

How do i generate the SSIS packges via code e.g. C# or SQL? I can imagine some kinda of shell script to the BimlEngine.dll e.g. BimlEngine.dll -"myFileServermyBimlScript", "generate SSIS packages"

我找到了这个 c# 代码项目https://github.com/jgsato/BimlGen

I have found this c# code project https://github.com/jgsato/BimlGen

特别是这个文件https://github.com/jgsato/BimlGen/blob/master/BimlGenerator.cs

我只是不确定如何使用它.

i'm just not sure how to use it.

感谢您的帮助.

推荐答案

您链接的代码是一种基于 SMO 生成 Biml、xml 的机制.

The code you linked is a mechanism for generating Biml, xml, based on SMO.

您的目的是重现右键单击/生成 SSIS 包,从而将 Biml XML 转换为 DTSX 的 XML.为此,您需要查看 BidsHelper 是如何做到的.在 BimlExpandPlugin 类中,您将找到对 BidsHelper 的版本特定调用.CompileBiml

Your intention is to reproduce the right click/generate SSIS package, thus converting the Biml XML into a DTSX's XML. To do this, you'll need to look at how BidsHelper does it. In the class BimlExpandPlugin, you'll find version specific calls to the BidsHelper.CompileBiml

ValidationReporter validationReporter = BidsHelper.CompileBiml(
    typeof(AstNode).Assembly, 
    "Varigence.Hadron.BidsHelperPhaseWorkflows.xml", 
    "Compile", bimlScriptPaths, 
    new List<string>(), 
    tempTargetDirectory, 
    projectDirectory, 
    SqlServerVersion.SqlServer2008, 
    SsisVersion.Ssis2012, 
    SsasVersion.Ssas2008, 
    DeployPackagesPlugin.IsLegacyDeploymentMode(project) ? 
        SsisDeploymentModel.Package : 
        SsisDeploymentModel.Project);

需要注意的是,Varigence 的人提供了 BidsHelper 存在的功能,作为其产品的子集,Mist,是有能力的.其中之一是跳过 XML 混搭,只使用本机 .NET 对象来创建和描述 SSIS 对象.如果您想使用 .NET 对象,则需要购买许可证.

Something to note is that the folks at Varigence provide the functionality that exists for BidsHelper as a subset of what their product, Mist, is capable of. One of those things is skipping the XML mashing and just use native .NET objects to create and describe SSIS objects. If you want to work with the .NET objects, then you'll need to buy a license.

这篇关于从BIML脚本自动生成SSIS包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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