我正在尝试使用 BIML 生成 SSIS 包。在该包中必须启用包配置(如下图所示)。所以这个包使用一个现有的配置文件(选项:重新使用 exsising)。
我正在使用以下版本:
- 操作系统:Windows 2008 R2 企业版
- 数据库:MSSQLSERVER 2012 投标
- (视觉工作室):2012
我尝试使用以下代码:
包配置部分
<!-- SET PACKAGE CONFIGURATION (DOES NOT WORK YET!!! ) -->
<PackageConfigurations>
<PackageConfiguration Name="ADWHConfig">
<ExternalFileInput ExtrnalFilePath="D:\ADWH\SSIS_ConfigFiles\ADWHConfig.dtsConfig">
</ExternalFileInput>
</PackageConfiguration>
</PackageConfigurations>
完整脚本
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<#
var cod_process = "80010007";
var strDestenationTable =" BLA_BLA";
#>
<Connections>
<OleDbConnection Name="LocalHost.ADWH01.dwh_user"
ConnectionString="Data Source=.;User ID=dwh_user;Initial Catalog=ADWH01;Provider=SQLNCLI11.1;database=ADWH01;Password=dbadmin_dwh;"
CreatePackageConfiguration="false">
</OleDbConnection>
</Connections>
<Packages>
<Package Name="TEST" ConstraintMode="Linear" >
<Variables>
<Variable Name="COD_INSTANCE" DataType="Int64">0</Variable>
<Variable Name="COD_PROCESS" DataType="Int64">0</Variable>
<Variable Name="ROW_COUNT" DataType="Int32">0</Variable>
<Variable Name="COD_PROCESS_STATUS" DataType="String"></Variable>
<!-- SET VARIABLES LOAD CALENDER -->
<Variable Name="LOAD_STRATEGY" DataType="String"></Variable>
<Variable Name="LOAD_CALENDER" DataType="Object"></Variable>
<Variable Name="FirstDayOfPeriod" DataType="DateTime">1/1/1900</Variable>
<Variable Name="LastDayOfPeriod" DataType="DateTime">1/1/1900</Variable>
<!-- SET VARIABLES LOAD SNAPSHOT -->
<Variable Name="LOAD_SNAPSHOTS" DataType="Object"></Variable>
<Variable Name="M_UTC_SNAPSHOT" DataType="DateTime">1/1/1900</Variable>
<Variable Name="M_COD_SOR" DataType="Int64">0</Variable>
</Variables>
<!-- SET PACKAGE CONFIGURATION (DOES NOT WORK YET!!! ) -->
<PackageConfigurations>
<PackageConfiguration Name="ADWHConfig">
<ExternalFileInput ExternalFilePath="D:\ADWH\SSIS_ConfigFiles\ADWHConfig.dtsConfig"></ExternalFileInput>
</PackageConfiguration>
</PackageConfigurations>
<Tasks>
<Dataflow Name="TEST 123">
<Transformations>
<OleDbSource Name="SNAPSHOT" ConnectionName="LocalHost.ADWH01.dwh_user">
<ExternalTableInput Table="DSAOMA.SNAPSHOT_D_KREDIETOVEREENKOMST2"></ExternalTableInput>
<Columns>
<Column SourceColumn="M_UTC_START" TargetColumn="M_UTC_START"></Column>
<Column SourceColumn="M_UTC_END" TargetColumn="M_UTC_END"></Column>
<Column SourceColumn="IDC_CONTRACT" TargetColumn="IDC_KREDIET_CONTRACT"></Column>
<Column SourceColumn="AFSCHRIJVINGSCODE_EWO_WOT" TargetColumn="AFSCHRIJVINGSCODE_EWO_WOT"></Column>
<Column SourceColumn="CONTRACTNUMMER" TargetColumn="ContractNummer"></Column>
<Column SourceColumn="DATUM_AANKOOP_KREDIET" TargetColumn="Datum_Aankoop_Krediet"></Column>
<Column SourceColumn="RISICOKLASSE" TargetColumn="Risicoklasse"></Column>
<Column SourceColumn="PROVISIEKLASSE" TargetColumn="Provisieklasse"></Column>
</Columns>
</OleDbSource>
<DerivedColumns Name="EXPRIndicatie_EWO_WOT">
<Columns>
<Column Name="Indicatie_EWO_WOT" DataType="VarNumeric" ReplaceExisting="false">!ISNULL(AFSCHRIJVINGSCODE_EWO_WOT) ? (DT_WSTR, 255)"J" :(DT_WSTR, 255) "N"</Column>
</Columns>
<InputPath OutputPathName="SNAPSHOT.Output"></InputPath>
</DerivedColumns>
</Transformations>
</Dataflow>
</Tasks>
</Package>
</Packages>
</Biml>
但这在我生成包时不起作用。请你帮我解决这个问题。我通过关注网站http://www.cathrinewilhelmsen.net/2014/06/17/package-configurations-and-connection-managers-in-biml/来实现这一点。