public void SetDataTypeProperties(SSISDataTypeWithProperty sSISDataTypeWithProperty) { if (sSISDataTypeWithProperty.DataType != SSISDataType.DT_EMPTY) { OutputColumn.SetDataTypeProperties(DtsUtility.EnumAToEnumB <SSISDataType, DataType>(sSISDataTypeWithProperty.DataType), sSISDataTypeWithProperty.Length, sSISDataTypeWithProperty.Precision, sSISDataTypeWithProperty.Scale, sSISDataTypeWithProperty.CodePage); } }
public void SetDataType(SSISDataTypeWithProperty sSISDataTypeWithProperty) { DataType = sSISDataTypeWithProperty.DataType; Length = sSISDataTypeWithProperty.Length; Precision = sSISDataTypeWithProperty.Precision; Scale = sSISDataTypeWithProperty.Scale; CodePage = sSISDataTypeWithProperty.CodePage; }
public static SSISDataTypeWithProperty GetSSISDataTypeFromADONetDataType(string adoNetDataType, int dataTypeLength, int scale = 0, int precision = 0) { SSISDataType dt = SSISDataType.DT_EMPTY; int codepage = 0; int length = 0; #region conv switch (adoNetDataType.ToLower()) { case "boolean": dt = SSISDataType.DT_BOOL; break; case "char": dt = SSISDataType.DT_STR; break; case "datetime": dt = SSISDataType.DT_DBTIMESTAMP; break; case "decimal": dt = SSISDataType.DT_NUMERIC; break; case "double": dt = SSISDataType.DT_R8; break; case "guid": dt = SSISDataType.DT_GUID; break; case "int16": dt = SSISDataType.DT_I2; break; case "int32": dt = SSISDataType.DT_I4; break; case "int64": dt = SSISDataType.DT_I8; break; //SByte //single case "string": dt = SSISDataType.DT_WSTR; break; case "timespan": dt = SSISDataType.DT_DBTIME; break; case "uint16": dt = SSISDataType.DT_UI2; break; case "uint32": dt = SSISDataType.DT_UI4; break; case "uint64": dt = SSISDataType.DT_UI8; break; } #endregion if (adoNetDataType.ToLower() == "string") { length = dataTypeLength; } SSISDataTypeWithProperty sdt = new SSISDataTypeWithProperty(); sdt.DataType = dt; sdt.Length = length; if (precision != 0) { sdt.Precision = precision; } else { sdt.Precision = 0; } if (scale != 0) { sdt.Scale = scale; } else { sdt.Scale = 0; } sdt.CodePage = codepage; return(sdt); }