• 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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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