Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Herleen Kaur
Starting Member
3 Posts |
Posted - 2010-11-30 : 07:50:05
|
| If I'll alter any existing table with columns having 'REAL' datatype by 'FLOAT' datatype, what will be this effect my data? |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2010-11-30 : 08:27:26
|
| No. They are synonyms so there will not be any change to the database whatsoever. Are you sure you want to use this data type though? Are you aware of the implications? What kind of data do you have in this column?- LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2010-11-30 : 10:27:31
|
| REAL and FLOAT are not the same. A FLOAT (FLOAT(53)) can store any value a REAL (FLOAT(24)) can hold but not the other way around. FLOAT is a higher precision version of REAL.REAL is a synonym of FLOAT(24) using 4 bytes of storage with a value range of -3.40E+38 to -1.18E-38, 0 and 1.18E-38 to 3.40E+38FLOAT is a synonym of FLOAT(53) using 8 bytes of storeage with a value range of -1.79E+308 to -2.23E-308, 0 and 2.23E-308 to 1.79E+308CODO ERGO SUM |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2010-11-30 : 10:43:22
|
Crap...I know I read in BOL that they were synonyms but I missed the (24)-part. Thanx for pointing it out! You learn something new every day... Although I hope I learned something else today as well that has more significance in my life than this - LumbagoMy blog (yes, I have a blog now! just not that much content yet) -> www.thefirstsql.com |
 |
|
|
jcelko
Esteemed SQL Purist
547 Posts |
Posted - 2010-11-30 : 10:49:55
|
quote: Originally posted by Lumbago Crap...I know I read in BOL that they were synonyms but I missed the (24)-part.
They were at one time in T-SQL, as I recall, back in the says of 16 bit UNIX hardware. In the ANSI/ISO Standards, there were differences because of binary versus base ten floating point numbers. But I would have to look them up; I tend to use DECIMAL(s,p) when I bigger or smaller numbers these days.--CELKO--Books in Celko Series for Morgan-Kaufmann PublishingAnalytics and OLAP in SQLData and Databases: Concepts in Practice Data, Measurements and Standards in SQLSQL for SmartiesSQL Programming Style SQL Puzzles and Answers Thinking in SetsTrees and Hierarchies in SQL |
 |
|
|
|
|
|