0

我正在 BIMLscript 中创建一个查找来创建一个带有查找的 ssis 包。我本质上只是想演示查找的功能,所以我正在查找表格本身。当我创建包时,它似乎构建得很好。但是,当我在 VS2013 中打开它时,会出现大量错误,如下所示:

错误 1 ​​验证错误。char1: char1: LKP_char1.Inputs[Extract_Output_LKP_char1].Columns[chr_1] 具有无效错误或截断行处置。字符.dtsx 0 0

char1 是表的名称,LKP_char1 是查找的名称,chr_1 是第一列的名称。有没有人对如何尝试和调试有任何想法。

我将 LookUp 标记的 NoMatchBehavior 属性设置为“IgnoreFailure”

<Dataflow Name="<#=table.SsisSafeName#>">
    <Transformations>
     <OleDbSource Name="Extract" ConnectionName="Source">
        <DirectInput>SELECT * FROM <#=table.SchemaQualifiedName#>
        </DirectInput>
    </OleDbSource>
    <Lookup Name="LKP_<#=table.Name#>" 
        NoMatchBehavior="IgnoreFailure" 
        OleDbConnectionName="Source">
            <ExternalTableInput Table="<#=table.SchemaQualifiedName#>">
            </ExternalTableInput>
            <Inputs>
            <# foreach (var column in table.Columns) { #>
                <Column SourceColumn="<#=column.Name#>" TargetColumn="<#=column.Name#>" />
            <# } #>
            </Inputs>
        <Outputs>
            <# foreach (var column in table.Columns) { #>
            <Column SourceColumn="<#=column.Name#>" TargetColumn="<#=column.Name#>" />
            <# } #>
        </Outputs>
    </Lookup>
    <# } #>
        <OleDbDestination Name="Load" ConnectionName="Source" UseFastLoadIfAvailable="false">
            <InputPath OutputPathName="LKP_<#=table.Name#>.Match" />
            <ExternalTableOutput Table="<#=table.SchemaQualifiedName#>" />
        </OleDbDestination>
    </Transformations>
</Dataflow> 
4

1 回答 1

1

您没有提供 biml,因此很难诊断问题,但这是一个带有两个查找的工作示例

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Connections>
        <Connection Name="AdventureWorks" ConnectionString="Provider=SQLOLEDB;Data Source=localhost\dev2014;Integrated Security=SSPI;Initial Catalog=AdventureWorks2014" />
    </Connections>
    <Packages>
        <Package Name="LookupDemo" ConstraintMode="Linear">
            <Tasks>
                <Dataflow Name="DFT Sample">
                    <Transformations>
                        <OleDbSource Name="OLE_SRC AW" ConnectionName="AdventureWorks" >
                            <DirectInput>SELECT * FROM (VALUES (N'TRL', 'Turkish Lira'), ('LEI', 'Romania'))D(Code, CurrencyName) cross apply
                                (VALUES (N'XRQ - TRUCK GROUND'),('ZY - EXPRESS')) D1(ShipMethod);</DirectInput>
                        </OleDbSource>

                        <Lookup Name="LKP Purchasing_ShipMethod" NoMatchBehavior="IgnoreFailure" OleDbConnectionName="AdventureWorks">
                          <DirectInput>SELECT
                            SM.ShipMethodID
                        ,   SM.Name
                        ,   SM.ShipBase
                        ,   SM.ShipRate
                        FROM
                            Purchasing.ShipMethod AS SM</DirectInput>
                          <Inputs>
                            <Column SourceColumn="ShipMethod" TargetColumn="Name" />
                          </Inputs>
                          <Outputs>
                            <Column SourceColumn="" TargetColumn="" />
                          </Outputs>
                        </Lookup>
                        <Lookup Name="LKP Sales_Currency" NoMatchBehavior="IgnoreFailure" OleDbConnectionName="AdventureWorks">
                          <DirectInput>SELECT
                            SC.CurrencyCode
                        ,   SC.Name
                        FROM
                            Sales.Currency AS SC;</DirectInput>
                          <Inputs>
                            <Column SourceColumn="Code" TargetColumn="CurrencyCode" />
                          </Inputs>
                          <Outputs>
                            <Column SourceColumn="CurrencyCode" TargetColumn="lkp_CurrencyCode" />
                            <Column SourceColumn="Name" TargetColumn="lkp_Name" />
                          </Outputs>
                        </Lookup>
                        <DerivedColumns Name="DER Placeholder for data viewer" />                       
                    </Transformations>
                </Dataflow>
            </Tasks>
        </Package>
    </Packages>
</Biml>
于 2016-08-20T02:04:04.757 回答