Пример #1
0
        public void AssociateWithOutputColumn(string outputColumnName)
        {
            ISOutputColumn outCol = new ISOutputColumn(ParentComponent, Output.Name, outputColumnName, RowDisposition.RD_FailComponent, RowDisposition.RD_FailComponent);

            outCol.SetDataTypeProperties(DataType, Length, Precision, Scale, CodePage);
            outCol.OutputColumn.ExternalMetadataColumnID = ID;

            IDTSOutput100 errorOutput = null;

            for (int o = 0; o < ParentComponent.ComponentMetaData.OutputCollection.Count; o++)
            {
                if (ParentComponent.ComponentMetaData.OutputCollection[o].IsErrorOut == true)
                {
                    errorOutput = ParentComponent.ComponentMetaData.OutputCollection[o];
                }
            }

            bool errorColExists = false;
            int  errorColCount  = errorOutput.OutputColumnCollection.Count;

            for (int e = 0; e < errorColCount; e++)
            {
                if (errorOutput.OutputColumnCollection[e].Name == outputColumnName)
                {
                    errorColExists = true;
                }
            }

            if (!(errorColExists))
            {
                IDTSOutputColumn100 o = errorOutput.OutputColumnCollection.NewAt(errorColCount - 2);
                o.Name = outputColumnName;
            }
        }
Пример #2
0
        public ISOutputColumn AddDerivedColumn(string columnName, string expression, string expressionCols, SSISDataType dataType, int length = 0, int precision = 0, int scale = 0, int codePage = 0, RowDisposition errorRowDisposition = RowDisposition.RD_FailComponent, RowDisposition truncationRowDisposition = RowDisposition.RD_FailComponent)
        {
            if (!(String.IsNullOrEmpty(expressionCols)))
            {
                SetUsageTypeToReadForExpressionCols(expressionCols);
            }

            ISOutputColumn oc = new ISOutputColumn(this, this.GetOutputFromIndex(0).Name, columnName, errorRowDisposition, truncationRowDisposition);

            oc.SetDataTypeProperties(dataType, length, precision, scale, codePage);
            SetCustomPropertyToOutputColumn(oc.Output, oc.OutputColumn, "Expression", expression);
            SetCustomPropertyToOutputColumn(oc.Output, oc.OutputColumn, "FriendlyExpression", expression);
            return(oc);
        }
Пример #3
0
        public void AddLookUpColumnIntoDataFlow(string lookupColumnName, string lookupColumnNameAlias, RowDisposition truncationRowDisposition, SSISDataType dataType, int length, int precision, int scale, int codePage, string inputColumnToReplace = null)
        {
            if (String.IsNullOrEmpty(inputColumnToReplace))
            {
                ISOutputColumn oc = new ISOutputColumn(this, MatchOutput_m.Name, lookupColumnName, RowDisposition.RD_NotUsed, truncationRowDisposition);
                oc.SetDataTypeProperties(dataType, length, precision, scale, codePage);
                SetCustomPropertyToOutputColumn(MatchOutput_m.Name, lookupColumnName, "CopyFromReferenceColumn", lookupColumnName);
                oc.Name = String.IsNullOrEmpty(lookupColumnNameAlias) ? lookupColumnName : lookupColumnNameAlias;
            }

            else
            {
                ISInputColumn ic = new ISInputColumn(this, _input.Name, inputColumnToReplace, UsageType.UT_READWRITE);
                SetCustomPropertyToInputColumn(ic.Input, ic.InputColumn, "CopyFromReferenceColumn", lookupColumnName);
                ic.Name = String.IsNullOrEmpty(lookupColumnNameAlias) ? lookupColumnName : lookupColumnNameAlias;
                _renamedInputCols.Add(new string[] { inputColumnToReplace, ic.Name });
            }
        }