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 Programming
 please solv this?

Author  Topic 

raky
Aged Yak Warrior

767 Posts

Posted - 2008-01-10 : 22:34:43
I came to know that decimal and numeric datatypes are equal then when we go for money datatype? Is there precision and scale values for money datatype just like numeric and decimal datatypes have? when i specify some value for money datatype ,it is getting rounded to 4 digits to the right of decimal point. can i alter this size(rounded values size). For clarity iam providing with example . plz go through it.

declare @t table (a money)
insert into @t values( 2333.45455)
select * from @t

nathans
Aged Yak Warrior

938 Posts

Posted - 2008-01-10 : 23:51:27
if you need more than 4 to the right then use decimal

Nathan Skerl
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2008-01-10 : 23:54:49
quote:
Originally posted by nathans

if you need more than 4 to the right then use decimal

Nathan Skerl



what u said is ok but i want to know whether i can use money data type in that case also or not? that's what i need . plz tell me.
thanks for ur reply...
Go to Top of Page

nathans
Aged Yak Warrior

938 Posts

Posted - 2008-01-11 : 03:40:00
no, you will need to use numeric/decimal if you wish to specify precision or scale.

See BOL for more info:

"...money will allow you values from -2^63 (-922,337,203,685,477.5808) through 2^63 - 1 (+922,337,203,685,477.5807)"



Nathan Skerl
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2008-01-11 : 22:55:28
quote:
Originally posted by nathans

no, you will need to use numeric/decimal if you wish to specify precision or scale.

See BOL for more info:

"...money will allow you values from -2^63 (-922,337,203,685,477.5808) through 2^63 - 1 (+922,337,203,685,477.5807)"

thanks alot


Nathan Skerl

Go to Top of Page
   

- Advertisement -