2017-10-19 40 views
0

我幾乎準備了BIML文件,但我還有一個問題轉換合併連接成BIML - 需要NumKeyColumns改爲1

我試圖把標準合併加入到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將在0填補我找不到NumKeyColumns 但是是必須是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> 

任何幫助是極大的讚賞

回答

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> 
+1

你做到了! 是的,我錯過了(我想我補充說,但也許在另一個測試版本) 我測試了2次,看看它是否真的工作,是的它做到了! 謝謝,我也愛喝茶:-) – John