October 24, 2008 at 7:52 am
Which data type is best practice?
Numeric or Decimal for storing (10,2) ie. 60.50 or 44.59, etc.,,,
Thanks.
October 24, 2008 at 9:03 am
http://msdn.microsoft.com/en-us/library/ms187746(SQL.90).aspx
SQL Server 2005 Books Online (September 2007)
decimal and numeric (Transact-SQL)
Numeric data types that have fixed precision and scale.
decimal[ (p[ , s] )] and numeric[ (p[ , s] )]
Fixed precision and scale numbers. When maximum precision is used, valid values are from - 10^38 +1 through 10^38 - 1. The SQL-92 synonyms for decimal are dec and dec(p, s). numeric is functionally equivalent to decimal.
I would use DECIMAL(10,2)
October 24, 2008 at 9:06 am
I don't think it matters. I think most SQL Server folks use decimal, but from what I understand they are handled the same way by SQL Server.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
October 24, 2008 at 12:01 pm
Ok. I'm going with numeric as I see it was used at few places in my project. My only concern was I'm not sure which (numeric or decimal) would be retired from SQL Server in the future.
Thanks.
October 24, 2008 at 12:06 pm
My bet is on NUMERIC being deprecated (keeping DECIMAL)
but it's an easy fix of Find-and-Replace anyway, and probably be a long while anyway
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply