in sqlserver database when i type 2.5 and save they did not taken decmical values how to do.when i save and again open only 2 not 2.5.
i need 2.5.
how to do.please help me
Rgds,
Narasiman P
Sqlserver
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

sudharsan s110 reputationPosted Jul 5, 2012, 10:13 PM EDT
what was the data type you given to that field? check it?
if you given int means change that into float or decimal ,numeric(10,2).
try this.
Hint : numeric(10,2)
2 represent maximum value display after decimal point.
Blocked AccountRank #403 · 6.2K reputationPosted Jul 5, 2012, 10:14 PM EDT
Check the data type of column, in which you are storing value. I think it's int datatype.
If you want to store decimal values then take Float,decimal and numeric datatype instead of int.
Thanks
Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 5, 2012, 10:22 PM EDT
Change the Data Type to
decimal(18, 1)
Thanks
Pankaj RanaRank #2,270 · 620 reputationPosted Jul 6, 2012, 1:12 AM EDT
The statement decimal (p, s) with p as precision and s as scale represents a decimal number with up to p digits and s of them will be on the right of the decimal point.
DECLARE @d decimal(8, 3)
SET @d=12345.67
SELECT @d
12345.670