Scale and precision in SQL 2008

I am trying to build a script that will distirbute large numbers over a range distrinbuted values: 1,000,000 distributed over 7000 recorfds with varying ratio. So far, I hav eonly been able to scale out to 6 on the presicion. I would liek the scale to be at least 10. I have been using decimal18,10, but it still caps at 6. Is there any thjing I cna do to tfix this? It sthrough my disotribution off by a few points.
jlhmeadAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ralmadaCommented:
decimal has a maximum precision of 38 so I'm not sure what you mean that it still caps at 6. Can you please clarify what are you trying to do? In the mean time did you try with more precision decimal(24,10) for instance?
0
ralmadaCommented:
0
jlhmeadAuthor Commented:
It was only display 6 decimal places. I reslised the denomiator drive the scale so I had to make sure that al the fields that were invloved in the calculation were set at decimal 18,10. That did the trick.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

ralmadaCommented:
absolutely, just so you know in SQL if you divide integers you will get integers    5 / 2 = 2 not 2.5

If you want decimals can simply multiply by "1.0"  for instance 5 * 1.0 / 2 = 2.5 that will do an implicit conversion.
0
jlhmeadAuthor Commented:
An example: 1500/7615827.14 should return a value of 0.000196958

What I am seeing on the file is a value of 0.000196000

I did the first calculation in excel

Any ideas why this is happeing?

I am using decimal(18,10)

0
ralmadaCommented:
you might try cast(1500 as decimal(18,10)) / cast(7615827.14 as decimal(18,10)) to be 100% sure that both are decimals. But also you might consider converting to float. Although float are not precise numbers, so you might have some discrepancies...

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jlhmeadAuthor Commented:
That worked so thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.