Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

sql data types

hi, what is the ideal data type in sql 2005 to store numbers and half numbers, like 1,1.5,2,2.5 etc...?
0
bfuchs
Asked:
bfuchs
4 Solutions
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
The Decimal type is always a good choice.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
numeric(5,1)
0
 
Surendra NathTechnology LeadCommented:
decimal(18,2) will be a good fit
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
bfuchsAuthor Commented:
hi, by default it comes as decimal(18, 0), what are those values in parenthesis?
also i had it currently stored all as int, is it safe to just change the data type manually?
0
 
Surendra NathTechnology LeadCommented:
the decimal data type is defined as below
decimal(p,s)

p--> precision (total number of digits in the number including the fractional numbers)
s--> scale (total number of fractional numbers)

More about this can be found here
http://msdn.microsoft.com/en-us/library/ms187746.aspx

Yes, it is safe to convert Int to decimal ( but not the other way around)
0
 
bfuchsAuthor Commented:
Hi experts,
Not sure if I am awarding properly the points here:)
Will use the decimal option since the majority here are for it.
Really appreciate your quick responses,
Ben
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now