• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2426
  • Last Modified:

SQL, Store currency values as Money, Float, or Int?

I'm writing a program for processing stocks (doesn't everyone at some point or another?).

These are U.S. stocks, priced in dollars and cents, with penny stocks sometimes priced to a tenth of a cent.

These values could be typed as money, float, or int (multiply by 1000 before storing).  

Are there performance advantages to storing as scaled integers?  Are there disadvantages?  I'm using SQL Server Express 2005.

I'd like some advice.

Thank you.
0
josgood
Asked:
josgood
  • 2
  • 2
1 Solution
 
HoggZillaCommented:
I have worked with many such scenarios, had to integrate system which all used a differnt format, and had to output data in all of these formats. What I have learned through all of this is that personal preference is the correct answer. As I like to see the values in the database in true form I would choose currency.
0
 
HoggZillaCommented:
0
 
josgoodAuthor Commented:
I'm all for personal preference! :)

I'd expect money and float to require more processing than a scaled integer.

Am I wrong?
0
 
josgoodAuthor Commented:
Thank you.  That URL gives me exactly the data I need to make a decision.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

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