SQL Server Data Type to use for Whole Number

WHat is the best data type to use for a table column to contain whole numbers?  These are amounts but do not need a decimal so I assuming Integer would be best type to use.  They will be need to be formatted on reports with ","

For example;  45000   or 67000
hojohappyAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
you can use int, and for fromating purpose you can convert them
0
 
Surendra NathConnect With a Mentor Technology LeadCommented:
yes it is good to INT, if the amounts are too big then you can use BIGINT.
0
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
int, bigint, smallint, and tinyint, whichever is the smallest storage size to handle the range of numbers you're dealing with, and on the assumption that there will never be a non-number other than NULL to handle.
0
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
if you are using sql server 2012, you can use the FORMAT statement to format the results

select FORMAT(10000, '###,###,###,###')
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>They will be need to be formatted on reports with ","
Recommend you store this in the database as one of the above int types, and let whatever reporting tool you're using handle the thousands-separating commas.
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.

All Courses

From novice to tech pro — start learning today.