troubleshooting Question

Dealing with Exponent Values in Mssql 2005

Avatar of smssimon
smssimon asked on
Microsoft SQL Server 2005
7 Comments1 Solution449 ViewsLast Modified:
create table temp (num float)

insert into temp values (6520008854656651321653)

select * from temp
Returned Result:
num
6.52000885465665E+21

Expected Result:
num
6520008854656651321653


when i insert such large value (6520008854656651321653)  in the column with the data type as float , it gets stored in the exponential format (6.52000885465665E+21).

Now, after a while if i want to get the exact value i have entered, what should i be doing??

Please suggest if there is a way i can store any large value in the table as i give. what is the data type i have to use. Also to be noted,this column is

hugely used for calculation purpose. So, i want it to be stored in a way so that it doesn't hamper the existing calculation logics.
create table temp (num float)
 
insert into temp values (6520008854656651321653)
 
select * from temp 
Returned Result:
num
6.52000885465665E+21
 
Expected Result:
num
6520008854656651321653
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros