Setting precision of a float data type

I am trying to create a table with a column of type 'float(24)' in SQL Server 2000. When I do that via Enterprise Manager, the Precision field is grayed out, so I cannot change it from the default value of 53. I tried to create a table running a script like this:

CREATE TABLE [dbo].[MyTable] (
      [X] [float(24)] NULL
) ON [PRIMARY]

but I am getting an error "Cannot find data type float(24).". So I have no idea, how the precision can be defined for this data type. Looks like a simple issue, and because of this it's even more frustrating. Can anybody enlighten me, please?
nebfisAsked:
Who is Participating?
 
Göran AnderssonConnect With a Mentor Commented:
What you are looking for is the data type real.

According to the documentation, you should be able to use float(24) to get a real, but perhaps that doesn't work in SQL Server 2000.
0
 
lundnakCommented:
Use Decimal(24,6) instead.  I don't believe float has precision.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
what kind of data do you want to store, actually?
0
 
nebfisAuthor Commented:
GreenGhost:
Thank you. Yes, according to documentation it should be possible, and that's what irritates me. It's one of the most confusing pieces of documentation I've recently seen. I can declare a variable to be of type float(12), for example, and it works perfectly fine, but I cannot create a table column of this type. Oh, well...
In my case I'll have to go with 'real'.

lundnak:
Using Decimal(24,6) is not a solution because what I need is a number in floating point format.

angelIII:
I have to be able to store numbers in floating point format.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.