Re: Q: Precision in SQL server 2000

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks xAvailx

It is a measure of temperatures and velocities. I only need 3-4 decimal
places.

G

"xAvailx" <bjzamora@xxxxxxxxxxx> wrote in message
news:1161185135.976065.80420@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
How do you use your script. <<

You can run in Query Analyzer. Make sure you try this on a test server
first....there is no undo in SQL (unless you wrap in transaction and
roll back).

If you tell us what you are trying to store, we may be able to point
whether the data type you are using is "correct".

HTH

G .Net wrote:
Hi xAvailx

Ah, yes I am using EM and I'm afraid I'm a newbie :(

How do you use your script. I'm afraid I'm lost.


"xAvailx" <bjzamora@xxxxxxxxxxx> wrote in message
news:1161114953.036317.276730@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The problem is that within sql server 2000 I don't see how to change
n
i.e. it is fixed as 53. <<

I am assuming you are referring to Enterprise Manager. I would stay
away from EM, specially when making any changes to your table schema.

The following script shoud work:

Alter Table YourTable
Alter Column YourCol
float(n)

May want to make sure you really want a float to store whatever you are
storing as lucm pointed.

HTH

G .Net wrote:
Hi xAvailx

Thanks for the information.

What you say makes sense. The problem is that within sql server 2000 I
don't
see how to change n i.e. it is fixed as 53.


"xAvailx" <bjzamora@xxxxxxxxxxx> wrote in message
news:1161108071.235919.290120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Unless I am not understanding your question...the following is from
BOL:

float [ ( n ) ]

Is a floating point number data from - 1.79E + 308 through 1.79E +
308.
n is the number of bits used to store the mantissa of the float
number
in scientific notation and thus dictates the precision and storage
size. n must be a value

FROM 1 THROUGH 53. <<--LOOK HERE

n is Precision Storage size
1-24 7 digits 4 bytes
25-53 15 digits 8 bytes

HTH

G .Net wrote:
Hi

I'm hoping somebody can help me with the following problem:

I have a table which has several fields holding floats. These
floats
need
only be stored to 3-4 decimal places, however, as far as I can see,
the
floats in sql server 2000 have a precision of 53 - far too much
precision.

I'm using ado.net to download this table to a .net application and
because
there are several thousand rows, and the length of each field is
large,
it
is taking too long to download the entire table.

Does anybody have a solution as to how I can store these values to
the
3-4
decimal places and reduce the download time?

Thanks in advance





.



Relevant Pages

  • Re: Q: Precision in SQL server 2000
    ... May want to make sure you really want a float to store whatever you are ... in scientific notation and thus dictates the precision and storage ... I have a table which has several fields holding floats. ... is taking too long to download the entire table. ...
    (microsoft.public.sqlserver)
  • Re: Q: Precision in SQL server 2000
    ... in scientific notation and thus dictates the precision and storage ... I have a table which has several fields holding floats. ... is taking too long to download the entire table. ...
    (microsoft.public.sqlserver)
  • Re: Q: Precision in SQL server 2000
    ... in scientific notation and thus dictates the precision and storage ... I have a table which has several fields holding floats. ... I'm using ado.net to download this table to a .net application and because ... Does anybody have a solution as to how I can store these values to the 3-4 ...
    (microsoft.public.sqlserver)
  • Q: Precision in SQL server 2000
    ... I have a table which has several fields holding floats. ... floats in sql server 2000 have a precision of 53 - far too much precision. ... I'm using ado.net to download this table to a .net application and because ...
    (microsoft.public.sqlserver)
  • Re: dyalog
    ... APL will automatically "blow up" the data type to complex if required ... 64-bit product is that it is not clear where they fit in the sequence, ... as they have more precision than floats (IEEE double precision floats ...
    (comp.lang.apl)