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
 General SQL Server Forums
 New to SQL Server Administration
 how to tell the db not to add trailling zeroes?

Author  Topic 

elic05
Yak Posting Veteran

62 Posts

Posted - 2009-07-26 : 11:25:11
i have a cell that stores smallmoney
if i insert 2.25 i see in the table 2.2500
if i insert 5 i see in the table 5.0000

how can i change this datatype default behaviour so it won't format my data???

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-07-26 : 11:38:19
Dup post: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=130034


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

elic05
Yak Posting Veteran

62 Posts

Posted - 2009-07-26 : 12:31:41
but this part of the question belongs here, cause it has to do with administration of the db
and the another part of the question has to do with writing a query.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-07-26 : 18:05:06
make it a Decimal(x, 2) if you want only 2 digits right of the decimal (where x is the total # of digits allowed)

See scale and precision in BOL
Go to Top of Page
   

- Advertisement -