Re: int Versus decimal



INT only uses 4 bytes because it doesn't have the precision that DECIMAL
has. How are you hoping to maintain the same precision when converting back
and forth?

By the way, if your column uses a precision up to 9 digits (decimal), it
will only use 5 bytes.


--
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--


"Herb Ray" <herb@xxxxxxxxx> wrote in message
news:JzfWe.170$Zl2.10211487@xxxxxxxxxxxxxxxxx
> Howdy - -
>
> I have to keep time series on large amounts of numeric data (millions
> of rows). I had the idea of storing these data as int and converting to
> decimal in views; this way, my numeric columns shrink down to four bytes
> from 9 bytes.
>
> Would the performance gained be an improvement even with the conversion
> overhead of the view?
>
> - - Herb


.



Relevant Pages

  • Re: test whether a double is even?
    ... > On my machine an int is 32 bits, so I would lose precision by converting ... Your original question was about testing a number if it's ... course you may loose precision casting a big number to int, short, or char, ...
    (comp.programming)
  • Re: Linux oddity
    ... > When converting a double to an int, ... > I'd expect on Linux: ... cases and 64 bit precision in the later case. ...
    (comp.lang.cpp)
  • Re: 12 hour clock and offset problem
    ... not violate precision in time based on precise longitude location. ... even more complex if adjustment is made including seconds. ... is lessened by use of the int() function within perl core. ...
    (comp.lang.perl.misc)
  • Re: double to int conversion yields strange results
    ... giving me two different values for the int. ... the question raised is not about the precision of the ... is done in extended precision. ... It is the conversion to 'double' before the conversion to 'int' that ...
    (comp.lang.c)
  • Re: [C] [newbie] problem reading from file
    ... why did you declare two variables in one statement here? ... note that it returns an int, ... actually I would consider converting all this inner loop to a for-loop ... that places each input character into number as long as there is still ...
    (alt.comp.lang.learn.c-cpp)

Quantcast