Converting from DT_STR to DT_R8

  • I have a field in a SSIS package of type DT_STR and I need to store the value in a table that has a column of type DT_R8. The problem is that the value of the DT_STR field gets changed after it gets loaded into the column of type DT_R8. For example, the DT_STR value is 201307230305591.2, but after loading that in the table the value is 201307230305591. Also, I tried converting the DT_STR to DT_R8 before loading it in the table, but still the value is 201307230305591.

  • Are you writing this to a relational database table? If so, what is the data type of the destination column for this value?

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

  • yes. float

  • If that's the case, there are a few troubleshooting steps I'd recommend:

    First, add a Data Viewer to each data pipeline in your data flow. This will allow you see the data as it passes from one component to the next, and you'll be able to tell if the rounding is taking place in the package itself, and if so, exactly where it happens.

    If that doesn't reveal anything, look at the advanced properties of the destination component (right click and select "show advanced settings"). Make sure that the column metadata is correct, and not using a whole number type such as DT_I8.

    Finally, if all else fails, delete and recreate the destination component to see if this resolves the issue.

    Hope this helps...

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

  • Thanks Tim. I already had tried your recommendations, but I still couldn't get the correct value saved in the table. I couldn't solve this issue at the end.

  • rs80 (8/5/2013)


    Thanks Tim. I already had tried your recommendations, but I still couldn't get the correct value saved in the table. I couldn't solve this issue at the end.

    Please explain at what point in the data pipeline the rounding occurs.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 6 posts - 1 through 5 (of 5 total)

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