Showing posts with label decimal. Show all posts
Showing posts with label decimal. Show all posts

Sunday, March 25, 2012

Best Real Datatype

Hi all,
I have several columns which store currency values (typically up to 4
integer values, plus two decimal places)
Using Enterprise Manager I can set a column as decimal type, but it doesn't
allow me to specify precision) and any values show as the integer amount plu
s
.00 (ie 123.45 shows as 123.00). I converted these fields to money, but
several stored procedures showed a slow-down.
What is the most efficient datatype for storing very low precision real
numbers? What went wrong with my decimal datatype?
Many thanks in advance!Within EM look at the bottom half of the window. You will see a precision
and scale attribute there.
Keith Kratochvil
"GeorgeBR" <GeorgeBR@.discussions.microsoft.com> wrote in message
news:B8499051-76E7-4F2E-8650-971709333F6D@.microsoft.com...
> Hi all,
> I have several columns which store currency values (typically up to 4
> integer values, plus two decimal places)
> Using Enterprise Manager I can set a column as decimal type, but it
> doesn't
> allow me to specify precision) and any values show as the integer amount
> plus
> .00 (ie 123.45 shows as 123.00). I converted these fields to money, but
> several stored procedures showed a slow-down.
> What is the most efficient datatype for storing very low precision real
> numbers? What went wrong with my decimal datatype?
> Many thanks in advance!|||Also, don't use the money type. In addition to the performance issues you
are seeing, you will get rounding errors with money.
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:e$STqrafGHA.1208@.TK2MSFTNGP02.phx.gbl...
> Within EM look at the bottom half of the window. You will see a precision
> and scale attribute there.
>
> --
> Keith Kratochvil
>
> "GeorgeBR" <GeorgeBR@.discussions.microsoft.com> wrote in message
> news:B8499051-76E7-4F2E-8650-971709333F6D@.microsoft.com...
>

Saturday, February 25, 2012

Best Data Type for...

What is the best data type to use to store numbers with limited decimal
places - ie. 1.25?
ThanksKeith,
Decimal or Numeric will do, eg numeric(10,2). They have 2 arguments -
precision and scale, with scale referring to the maximum number of decimal
places (2 in the example above). Have a look in BOL at "decimal data type,
overview".
HTH,
Paul Ibison|||Thank you
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OVihrFQLEHA.644@.tk2msftngp13.phx.gbl...
> Keith,
> Decimal or Numeric will do, eg numeric(10,2). They have 2 arguments -
> precision and scale, with scale referring to the maximum number of decimal
> places (2 in the example above). Have a look in BOL at "decimal data type,
> overview".
> HTH,
> Paul Ibison
>