Derived Column drop decimal points

  • The field I would like to change is chg_quantity

    My DataReaderSource Input output property lists External columns as numeric [DT_NUMERIC] Precision 6, and Scale 0. Output column lists chg_quantity as numeric [DT_NUMERIC] Precision 6, Scale 2. When I try and change the scale here from 2 to 0 I get the following...

    "Error at Data Flow Task [DataReader Source [22]]: The data type of output columns on the component "DataReader Source" (22) cannot be changed. Error at Data Flow Task [DataReader Source [22]]: System.Runtime.InteropServices.COMException (0xC020837D)"

    My source chg_quantity field is always a whole number but once I run it through SSIS and place my output into a txt file "0" is coming out as ".00". How can I get this back to just "0". Thank you!

  • What source component are you using?

    You can always use a Data Conversion component and cast the column explicitly to integer.

    Remember, this component doesn't actually cast a column, it rather creates a copy of that column with the casted values. Check your mappings in the destination!

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (7/8/2011)


    What source component are you using?

    You can always use a Data Conversion component and cast the column explicitly to integer.

    Remember, this component doesn't actually cast a column, it rather creates a copy of that column with the casted values. Check your mappings in the destination!

    Thanks Koen, I was able to get it to work by using the derived column expression (DT_NUMERIC,6,0)chg_quantity and numeric dt_numeric data type.

    I appreciate it!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply