none
SSIS 2008: export varchar(14) decimal value to text file and loose trailing zero

    Question

  • We have a varchar(14) table column with values like

    12.34

    4.56

    2.70

    (That is: $12.34, $4.56, and $2.70)

    When we export these values to a text file using SSIS we get

    12.34

    4.56

    2.7   <-- trailing zero removed

    We were expecting "2.70" for the last entry.  How can we get it back?

    edm2

    Tuesday, October 29, 2013 3:09 AM

Answers

  • Did you check the data type for the column in connection manager advanced properties for this column.Is it DT_STR.Example image is given below.

    Flat File Connection Manager Editor - Advanced

    Also,

    Check the output column properties in advanced editor of OLE DB source.it should also say DT_STR.Example image is given below

    SortKeyPosition


    Vinay Valeti| If you think my suggestion is useful, please rate it as helpful. If it has helped you to resolve the problem, please Mark it as Answer


    • Edited by Vinay Valeti Tuesday, October 29, 2013 3:48 AM
    • Marked as answer by edm2 Wednesday, October 30, 2013 4:19 AM
    Tuesday, October 29, 2013 3:42 AM

All replies

  • Did you check the data type for the column in connection manager advanced properties for this column.Is it DT_STR.Example image is given below.

    Flat File Connection Manager Editor - Advanced

    Also,

    Check the output column properties in advanced editor of OLE DB source.it should also say DT_STR.Example image is given below

    SortKeyPosition


    Vinay Valeti| If you think my suggestion is useful, please rate it as helpful. If it has helped you to resolve the problem, please Mark it as Answer


    • Edited by Vinay Valeti Tuesday, October 29, 2013 3:48 AM
    • Marked as answer by edm2 Wednesday, October 30, 2013 4:19 AM
    Tuesday, October 29, 2013 3:42 AM
  • Vinay,

    Very good suggestions but in my case the columns show "DT_STR" in both the File Connection Manager and in the Advanced Editor for the OLE DB source.

    edm2

    Tuesday, October 29, 2013 4:24 AM
  • Hi Vinay,

    The source will be string as you are using a text file. you need to convert it to decimal or float value using data conversions with precision point 2 (depending on the requirement). There after the flow can be transferred to destination.

    -----------------------------------------------------------------------------------------------------------------------------------

    "It has helped you to resolve the problem, please Mark it as Answer"


    Ashokveer

    Tuesday, October 29, 2013 7:02 AM