2014-02-13 16 views
3

如何使用BID和BIML在SQL Server 2008中的模糊查找转换(FLT)对象中勾选复选框。我假设它将输出列添加到输出路径,我不知道?我想我的输出是只需使用SSIS在模糊查找转换对象中勾选复选框BIML

查找列=属性
查找列= AddThisColumn

输出别名= Attribute2
输出别名= AddThisColumn

下面是一个2X屏幕截图沿BIML脚本, 1)复选框AddThisColumn unticked(当前状态)2)复选框AddThisColumn打勾(我想)

  <Biml xmlns="http://schemas.varigence.com/biml.xsd"> 
       <Connections> 
       <OleDbConnection Name="SportsData" ConnectionString="Provider=SQLNCLI10;Server=myServer;Initial Catalog=myCatalog;Integrated Security=SSPI;" DelayValidation="true" /> 
       </Connections> 
       <Packages> 
        <Package Name="_my Package" ConstraintMode="Linear"> 
         <Tasks>  
          <Dataflow Name="My Dataflow Task"> 
           <Transformations> 
            <OleDbSource Name="SurveyResponses" ConnectionName="SportsData"> 
             <DirectInput>select * from SurveyResponses</DirectInput> 
            </OleDbSource> 
            <!-- Performs a fuzzy lookup on the Attribute column against the JuniorSurveyResponse DB, and outputs the corresponding Response column to NewResponse. --> 
            <FuzzyLookup Name="Fuzzy Lookup Transformation" ConnectionName="SportsData" Exhaustive="true" 
               MatchIndexName="dbo.JuniorSurveyResponsesIndex" DropExistingIndex="false" 
               CopyReferenceTable="true" WarmCaches="false" MatchIndexOptions="ReuseExistingIndex" ValidateExternalMetadata="false" > 
             <ExternalReferenceTableInput Table="dbo.JuniorSurveyResponses" /> 
             <Inputs> 
              <Column SourceColumn="Attribute" TargetColumn="Attribute" /> 
             </Inputs> 
             <Outputs> 
              <Column SourceColumn="Attribute" TargetColumn="Attribute2" /> 

             </Outputs> 
             <InputPath OutputPathName="SurveyResponses.Output" /> 
            </FuzzyLookup> 

           </Transformations> 
          </Dataflow> 
         </Tasks> 
        </Package> 
       </Packages> 
       </Biml> 

     <#@ template language="C#" hostspecific="true"#> 
     <#@ import namespace="System.Data" #> 
     <#@ import namespace="Varigence.Hadron.CoreLowerer.SchemaManagement" #> 

     <!-- 

     CREATE TABLE dbo.JuniorSurveyResponses 
     (
      Attribute varchar(50) 
     , Response varchar(50) 
     , AddThisColum varchar(50) 
     ); 

     CREATE TABLE dbo.SurveyResponses 
     (
      Attribute varchar(50) 
     , Response varchar(50) 
     ); 

     --> 

下面应该是输出图像,其中名为AddThisColumn的列未被选中。 addThisColumn is unchecked

下面应该是一个输出的图像,其中名为AddThisColumn的列是check。我如何编写脚本? addThisColumn is checked

回答

5

点击右侧的复选框表示您正在向输出添加一列,对吧?为了用biml表达这个想法,只需要在Outputs集合中为给定的转换添加另一个Column即可。

<Outputs> 
    <Column SourceColumn="Attribute" TargetColumn="Attribute2" /> 
    <Column SourceColumn="AddThisColum" TargetColumn="AddThisColumn" /> 
</Outputs> 

我用你早先的问题BIML导致我的截图将响应输出集合而不是增加属性更名为Attribute2,这是在上面的代码片段来完成。

Moar columns

+0

billinkc的另一个提示和出色的答案!作为我可能过分简化我的问题的一个附注,请留意另一个类似的问题。再次感谢billinkc – norm