Showing posts with label storage. Show all posts
Showing posts with label storage. Show all posts

Friday, March 9, 2012

Decimal vs currency....

It seems that the "decimal" type allows more flexibility but also uses more storage than "money". On the other hand, does "money" have any special t-sql functions that understand its unquie nature? (e.g. adding two money values together with no cents round-off error).

For example, would the number 12345.12 be declared as a decimal(7,2) or currency?

Barkingdog

There aren't any special functions that explicitly recognize a monetary data type. How you declare it really depends upon what you are storing in there. If I'm storing pricing or something else that is in monetary units, I use money. If I'm doing complex financial caculations, I use decimal, because the money data type is accurate to 4 decimal places and for calculating a lot of financial stuff, you need better accuracy than that.

Wednesday, March 7, 2012

Decimal data type: storage in bytes?

SQL 7.0
What is the storage in bytes of decimal data type?
Thanks,
DonDepends on the precision you want. Can go from 5 to 17 bytes. Look up the
topic "decimal and numeric (T-SQL)" in SQL Server 7.0 or 2000 Books Online.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Don" <anonymous@.discussions.microsoft.com> wrote in message
news:95ff01c4338d$ae53cf70$a501280a@.phx.gbl...
SQL 7.0
What is the storage in bytes of decimal data type?
Thanks,
Don

Decimal data type: storage in bytes?

SQL 7.0
What is the storage in bytes of decimal data type?
Thanks,
Don
Depends on the precision you want. Can go from 5 to 17 bytes. Look up the
topic "decimal and numeric (T-SQL)" in SQL Server 7.0 or 2000 Books Online.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Don" <anonymous@.discussions.microsoft.com> wrote in message
news:95ff01c4338d$ae53cf70$a501280a@.phx.gbl...
SQL 7.0
What is the storage in bytes of decimal data type?
Thanks,
Don

Decimal data type: storage in bytes?

SQL 7.0
What is the storage in bytes of decimal data type?
Thanks,
DonDepends on the precision you want. Can go from 5 to 17 bytes. Look up the
topic "decimal and numeric (T-SQL)" in SQL Server 7.0 or 2000 Books Online.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Don" <anonymous@.discussions.microsoft.com> wrote in message
news:95ff01c4338d$ae53cf70$a501280a@.phx.gbl...
SQL 7.0
What is the storage in bytes of decimal data type?
Thanks,
Don