Best data type for storing currency values in a MySQL database

Brian Fisher picture Brian Fisher · Mar 10, 2009 · Viewed 185.5k times · Source

What is the best SQL data type for currency values? I'm using MySQL but would prefer a database independent type.

Answer

Kibbee picture Kibbee · Mar 10, 2009

Something like Decimal(19,4) usually works pretty well in most cases. You can adjust the scale and precision to fit the needs of the numbers you need to store. Even in SQL Server, I tend not to use "money" as it's non-standard.