Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Converting from DT_STR to DT_R8 Expand / Collapse
Author
Message
Posted Friday, August 2, 2013 2:21 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, November 21, 2014 12:41 PM
Points: 100, Visits: 313
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.
Post #1480603
Posted Sunday, August 4, 2013 1:11 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, December 11, 2014 9:19 AM
Points: 1,046, Visits: 2,739
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, SQL Server MVP
Independent Business Intelligence Consultant
www.TimMitchell.net
@Tim_Mitchell

Post #1480786
Posted Monday, August 5, 2013 7:50 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, November 21, 2014 12:41 PM
Points: 100, Visits: 313
yes. float
Post #1480918
Posted Monday, August 5, 2013 8:14 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, December 11, 2014 9:19 AM
Points: 1,046, Visits: 2,739
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, SQL Server MVP
Independent Business Intelligence Consultant
www.TimMitchell.net
@Tim_Mitchell

Post #1480932
Posted Monday, August 5, 2013 11:57 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, November 21, 2014 12:41 PM
Points: 100, Visits: 313
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.
Post #1481021
Posted Monday, August 5, 2013 11:52 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:59 PM
Points: 5,317, Visits: 12,363
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.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1481159
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse