0

我几乎准备好使用 BIML 文件,但我还有一个问题

我试图将标准的 Merge Join 放入 biml 和 99% 的工作,生成组件并制作 dtsx 但我无法在任何地方设置 numKeyColumns 值

 <properties>
            <property dataType="System.Int32" description="Specifies the type of join to perform." name="JoinType" typeConverter="JoinType">0</property>
            <property dataType="System.Int32" description="Specifies the number of columns in the ordering key." name="NumKeyColumns">0</property>
            <property dataType="System.Boolean" description="Indicates whether the null values are treated as equal values." name="TreatNullsAsEqual">true</property>
            <property dataType="System.Int32" description="Indicates the requested maximum buffers per input before blocking." name="MaxBuffersPerInput">5</property>
          </properties>

我可以设置 jointype 但是当生成 dtsx 时找不到 NumKeyColumns 它将填写 0 但必须为 1

这是 biml 中的合并连接(没有传入连接)

            <MergeJoin Name="Merge Join" JoinType="FullOuterJoin">
          <LeftInputPath OutputPathName="Source.Output">
            <Columns>
              <Column SourceColumn="BK" IsUsed="true" SortKeyPosition="1" TargetColumn="sBK" />
              <Column SourceColumn="hbSource" IsUsed="true" />
            </Columns>
          </LeftInputPath>
          <RightInputPath OutputPathName="Dwh Destination.Output">
            <Columns>
              <Column SourceColumn="BK" IsUsed="true" TargetColumn="dBK" />
              <Column SourceColumn="hbDestination" IsUsed="true" />
            </Columns>
          </RightInputPath> 
        </MergeJoin>

任何帮助是极大的赞赏

4

1 回答 1

0

我认为您缺少 MergeJoin 的 JoinKey 属性。添加允许发出语法正确的 SSIS 包。逻辑上是否正确是另一回事;)

如果这不是你想要做的,请告诉我。乐于助人,爱 Biml。

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Connections>
        <OleDbConnection Name="SRC" ConnectionString="Provider=SQLNCLI11;Server=localhost\dev2016;Initial Catalog=tempdb;Integrated Security=SSPI;" />
    </Connections>
    <Packages>
        <Package Name="MergeJoin">
            <Tasks>
                <Dataflow Name="DFT Demo">
                    <Transformations>
                        <OleDbSource Name="Source" ConnectionName="SRC">
                            <Columns>
                                <Column SourceColumn="BK" SortKeyPosition="1" />
                            </Columns>
                            <DirectInput>SELECT 1 AS BK, 'foo' AS hbSource UNION SELECT 2, 'ick' order by 1;</DirectInput>
                        </OleDbSource>
                        <OleDbSource Name="Dwh Destination" ConnectionName="SRC">
                            <Columns>
                                <Column SourceColumn="BK" SortKeyPosition="1" />
                            </Columns>
                            <DirectInput>SELECT 1 AS BK, 'foo' AS hbDestination UNION SELECT 3, 'zoo' order by 1;</DirectInput>
                        </OleDbSource>
                        <MergeJoin Name="Merge Join" JoinType="FullOuterJoin">
                            <LeftInputPath OutputPathName="Source.Output">
                                <Columns>
                                    <Column SourceColumn="BK" IsUsed="true" SortKeyPosition="1" TargetColumn="sBK" />
                                    <Column SourceColumn="hbSource" IsUsed="true" />
                                </Columns>
                            </LeftInputPath>
                            <RightInputPath OutputPathName="Dwh Destination.Output">
                                <Columns>
                                    <Column SourceColumn="BK" IsUsed="true" TargetColumn="dBK" />
                                    <Column SourceColumn="hbDestination" IsUsed="true" />
                                </Columns>
                            </RightInputPath>
                            <JoinKeys>
                                <JoinKey LeftColumn="BK" RightColumn="BK" />
                            </JoinKeys>
                        </MergeJoin>
                    </Transformations>
                </Dataflow>
            </Tasks>
        </Package>
    </Packages>
</Biml>
于 2017-10-20T14:04:37.707 回答