예제 #1
0
        public static object GetPropertyValue(Dictionary <String, SSISProperty> propertyCollection, string name)
        {
            SSISProperty value = null;

            if (propertyCollection.TryGetValue(name, out value))
            {
                return(value.Value);
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        /// <summary>
        /// Creator of the SSISOutput class.  Will populate this class with all the relevant parts of an IDTSOutput100
        /// </summary>
        /// <param name="output">The IDTSOutput100 that you wish to collect all relevant data from</param>
        /// <param name="bufferManager">The buffer manager, or null.  This is used for the collection of column lineage into buffers.</param>
        public SSISOutput(IDTSOutput100 output, IDTSBufferManager100 bufferManager)
        {
            _customPropertyCollection = new Dictionary <string, SSISProperty>();
            _outputColumnCollection   = new List <SSISOutputColumn>();
            _name = "_" + System.Text.RegularExpressions.Regex.Replace(output.Name, @"[^a-zA-Z0-9]", String.Empty);
            _errorRowDisposition = output.ErrorRowDisposition;

            // Get the Custom Properties
            for (int i = 0; i < output.CustomPropertyCollection.Count; i++)
            {
                SSISProperty newProperty = new SSISProperty();
                newProperty.Name  = output.CustomPropertyCollection[i].Name;
                newProperty.Value = output.CustomPropertyCollection[i].Value;
                _customPropertyCollection.Add(newProperty.Name, newProperty);
            }

            // Get the Columns
            for (int i = 0; i < output.OutputColumnCollection.Count; i++)
            {
                SSISOutputColumn newColumn = new SSISOutputColumn(output.OutputColumnCollection[i], bufferManager, output.Buffer);
                _outputColumnCollection.Add(newColumn);
            }
        }
예제 #3
0
        //public SSISOutputColumn()
        //{
        //    _customPropertyCollection = new Dictionary<string, SSISProperty>();
        //}

        public SSISOutputColumn(IDTSOutputColumn100 outputColumn, IDTSBufferManager100 bufferManager, int bufferID)
        {
            _customPropertyCollection = new Dictionary <string, SSISProperty>();
            _name = "_" + System.Text.RegularExpressions.Regex.Replace(outputColumn.Name, @"[^a-zA-Z0-9]", String.Empty); //.Replace(" ", String.Empty).Replace("_", String.Empty).Replace("@", String.Empty);
            //_truncationRowDisposition = outputColumn.TruncationRowDisposition;
            _identificationString = outputColumn.IdentificationString;
            //_errorRowDisposition = outputColumn.ErrorRowDisposition;
            _lineageID = outputColumn.LineageID;
            _datatype  = outputColumn.DataType;
            for (int j = 0; j < outputColumn.CustomPropertyCollection.Count; j++)
            {
                SSISProperty newProperty = new SSISProperty();
                newProperty.Name  = outputColumn.CustomPropertyCollection[j].Name;
                newProperty.Value = outputColumn.CustomPropertyCollection[j].Value;
                _customPropertyCollection.Add(newProperty.Name, newProperty);
            }

            if (_customPropertyCollection.Count > 0)
            {
                switch ((Utilities.usageOfColumnEnum)_customPropertyCollection[ManageProperties.usageOfColumn].Value)
                {
                case Utilities.usageOfColumnEnum.RowType:
                    _isMasterOrKey = false;
                    _isRowData     = false;
                    _isRowType     = true;
                    _isDerived     = false;
                    break;

                case Utilities.usageOfColumnEnum.Passthrough:
                    _isMasterOrKey = false;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = false;
                    break;

                case Utilities.usageOfColumnEnum.Ignore:
                    _isMasterOrKey = false;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = true;
                    break;

                case Utilities.usageOfColumnEnum.Key:
                    _isMasterOrKey = true;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = true;
                    break;

                case Utilities.usageOfColumnEnum.MasterValue:
                    _isMasterOrKey = true;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = false;
                    break;

                case Utilities.usageOfColumnEnum.RowData:
                    _isMasterOrKey = false;
                    _isRowData     = true;
                    _isRowType     = false;
                    _isDerived     = false;
                    break;

                default:
                    _isMasterOrKey = false;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = true;
                    break;
                }

                if (_customPropertyCollection.ContainsKey(ManageProperties.keyOutputColumnID))
                {
                    if ((int)_customPropertyCollection[ManageProperties.keyOutputColumnID].Value > 0)
                    {
                        _isDerived = true;
                    }
                }
            }
            else
            {
                _isMasterOrKey = false;
                _isRowData     = false;
                _isRowType     = false;
                _isDerived     = false;
            }

            if (bufferManager != null)
            {
                _outputBufferID = bufferManager.FindColumnByLineageID(bufferID, outputColumn.LineageID);
            }
        }