?
Solved

decimal being rounded in v2008

Posted on 2009-05-04
8
Medium Priority
?
191 Views
Last Modified: 2013-11-10
Odd little thing I just noticed....
my datasource is SQL v2000, 'price' is the attribute in question, it is DECIMAL 9(18,8)
my destination is SQL v2008, 'price' is the same, it is DECIMAL 9(18,8)

I'm using v2008 SSIS to copy the data from source to destiniation (until we upgrade and get off the v2000 box).  it's a flat file source, created from a simple bcp out of the v2000 box, into sql server destination.  that's it.  no conversions, no nothing.

but get this... my price is being rounded

source:         96.78000000
destination:  96.00000000

i've checked the current flat file.   the price values are in there just fine, non-rounded.
and yes, I am certain that I am looking at the same record in source vs destination.  there's a TON of data in this thing.  i transferred upwards of 5M this morning, i just noted that price thing, so i've dug a little deeper and find that NONE of the prices equate.  not just today's 5M, but everything I've checked.  they've all been rounded down in the v2008 instance.  like this:

source:          72.33000000
destination:   72.00000000

any ideas at all?
0
Comment
Question by:dbaSQL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 24297252
You need to put a conversion task in your ssis package to convert it to 4 decimal spots.
0
 
LVL 17

Author Comment

by:dbaSQL
ID: 24297335
But why, chap?  the attribute is the same in the source and destination.  why would a conversion be necessary?
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 24297358
because SSIS does some funky stuff sometimes....
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 51

Accepted Solution

by:
Mark Wills earned 2000 total points
ID: 24317366
Should carry the decimals...

Double check the data types and scale... Or read flat file as a string and cast as decimal. Also look at using numeric datatype...
0
 
LVL 17

Author Comment

by:dbaSQL
ID: 24373357
>>Double check the data types and scale...
You are correct, Mr. Wills.  Having checked the datatype, i was numeric.  i'm unsure how that occurred, but i changed it within the source output definition.  had to reload everyting, but all is well.


thank you both for looking
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 24375591
Happy to help....

BTW, how is that machine performing now ?
0
 
LVL 17

Author Comment

by:dbaSQL
ID: 24375633
Performing exceptionally well.  (knock on some wood)
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 24375726
Good to hear :)
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question