protected override void ProcessBindingMappings(SsisEmitterContext context, MappedBinding mappedBinding, IDTSPath100 path) { if (mappedBinding != null && path != null) { foreach (AstDataflowColumnMappingNode map in mappedBinding.Mappings) { int lineageId; var matchedOutput = TransformationUtility.FindOutputColumnByName(map.SourceName, path.StartPoint, true); if (matchedOutput == null) { var matchedInput = TransformationUtility.FindVirtualInputColumnByName(map.SourceName, path.EndPoint, true); if (matchedInput == null) { MessageEngine.Trace(_astUnionAllNode, Severity.Error, "V0145", "Could not find input column {0} for transformation {1}", map.SourceName, _astUnionAllNode.Name); } lineageId = matchedInput.LineageID; } else { lineageId = matchedOutput.LineageID; } IDTSInputColumn100 ic = TransformationUtility.FindInputColumnByName(map.SourceName, path.EndPoint, true); if (ic == null) { ic = path.EndPoint.InputColumnCollection.New(); ic.Name = map.SourceName; ic.LineageID = lineageId; } IDTSOutputColumn100 oc = TransformationUtility.FindOutputColumnByName(map.TargetName, OutputPath, true); if (oc == null) { oc = OutputPath.OutputColumnCollection.New(); oc.Name = map.TargetName; oc.SetDataTypeProperties(ic.DataType, ic.Length, ic.Precision, ic.Scale, ic.CodePage); } IDTSCustomProperty100 cp = TransformationUtility.FindCustomPropertyByName("OutputColumnLineageID", ic.CustomPropertyCollection, true); if (cp == null) { cp = ic.CustomPropertyCollection.New(); cp.Name = "OutputColumnLineageID"; } cp.Value = oc.LineageID; } } }
protected virtual void ProcessBindingMappings(SsisEmitterContext context, MappedBinding mappedBinding, IDTSPath100 path) { if (mappedBinding != null && path != null) { foreach (AstDataflowColumnMappingNode map in mappedBinding.Mappings) { int lineageId; var matchedOutput = TransformationUtility.FindOutputColumnByName(map.SourceName, path.StartPoint, true); if (matchedOutput == null) { var matchedInput = TransformationUtility.FindVirtualInputColumnByName(map.SourceName, path.EndPoint, true); if (matchedInput == null) { // Message.Error throw new InvalidOperationException(); } lineageId = matchedInput.LineageID; } else { lineageId = matchedOutput.LineageID; } IDTSInputColumn100 ic = TransformationUtility.FindInputColumnByName(map.SourceName, path.EndPoint, true); if (ic == null) { ic = path.EndPoint.InputColumnCollection.New(); ic.LineageID = lineageId; } if (String.IsNullOrEmpty(map.TargetName)) { // TODO: What is the right way to destroy a column in dataflow? ic.UsageType = DTSUsageType.UT_IGNORED; } else { ic.Name = map.TargetName; } } } }