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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Inserting 100.0 in float column gives 100 in SQL Server. Why?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-12-13 : 09:48:42
Quark_se writes "Hi!

I've been trying to insert posts with floats using .0 as decimals, but SQL Server never saves the .0
How do I change this so when I insert 100.0 the post in my db will show 100.0 and not 100 as it does right now.
(I'm using SQL Server 2000)

And yes, I must have the decimal number even if its a 0.

I've tried using float, decimal and money as types, but none of them work.

Any ideas?"

royv
Constraint Violating Yak Guru

455 Posts

Posted - 2001-12-13 : 09:58:16
If you are not doing math operation on any of these numbers up, then change the column to a varchar.

*************************
Just trying to get things done

Edited by - royv on 12/13/2001 10:13:13
Go to Top of Page

webguru22
Starting Member

11 Posts

Posted - 2001-12-13 : 10:25:34
If you do need to do math on the numbers, maybe you could let it go in as 100 and just format it for display after you retrieve it. Don't know exactly what you ar edoing with it so that may not work.

HTH

Go to Top of Page
   

- Advertisement -