none
Data type conversion? RRS feed

  • Question

  • Hi All,

    I have OLEDB source, in which I'm fetching one column whose datatype is REAL.

    And I have OLEDB destination in which I'm keeping above REAL column into another column whose data-type is again REAL.

    but now before storing into destination column I want to store in format xxx.xx only.


    How can I do the same?


    Thanks


    regards,
    Kumar
    Wednesday, October 7, 2009 8:39 PM

Answers

  • You need to convert the data to Numeric(5,2)
    Hope this helps !!
    Sudeep      My Blog
    • Proposed as answer by ETL vs ELTL Wednesday, October 7, 2009 8:54 PM
    • Marked as answer by gk1393 Wednesday, October 7, 2009 9:33 PM
    Wednesday, October 7, 2009 8:44 PM
  • You can add a derived column and crete a new column using original column.
    Select its datatype as DT_NUMERIC and set the scale as 2
    Nitesh Rai- Please mark the post as answered if it answers your question
    • Marked as answer by gk1393 Wednesday, October 7, 2009 9:33 PM
    Wednesday, October 7, 2009 8:45 PM

All replies

  • You need to convert the data to Numeric(5,2)
    Hope this helps !!
    Sudeep      My Blog
    • Proposed as answer by ETL vs ELTL Wednesday, October 7, 2009 8:54 PM
    • Marked as answer by gk1393 Wednesday, October 7, 2009 9:33 PM
    Wednesday, October 7, 2009 8:44 PM
  • You can add a derived column and crete a new column using original column.
    Select its datatype as DT_NUMERIC and set the scale as 2
    Nitesh Rai- Please mark the post as answered if it answers your question
    • Marked as answer by gk1393 Wednesday, October 7, 2009 9:33 PM
    Wednesday, October 7, 2009 8:45 PM
  • thxs once again both you!!! awesome :)
    Wednesday, October 7, 2009 9:33 PM
  • Hey Nitesh,

    I used derived column and created a new column using orginial column with datatype as DT_NUMERIC with Precision as 6 and Scale as 2.

    It ran successfully for some few million records but after than it gave me error as :-

    SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "component "Derived Column" (15352)" failed because error code 0xC0049060 occurred, and the error row disposition on "output column "Mwr" (16212)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.


    For your better understanding I have OLEDB source from that I'm fetching Mwr column whose datatype is REAL, second one is Derived Column where I'm creating new column(nMwr) from this original column(Mwr) with Datatype as DT_NUMERIC with precision as 6 and scale as 2
    and finally mapping this new column(nMwr) into OLEDB destination column whose datatype is REAL


    any idea


    thxs


    regards,
    Kumar
    Wednesday, October 7, 2009 10:06 PM