SQL Server SMALLMONEY Data Type
SQL Server SMALLMONEY stores values from -214,748.3648 through 214,748.3647 with four fractional decimal places in 4 bytes. It represents a numeric amount, not a currency code.
Syntax
The syntax for creating a column of SMALLMONEY type is as follows:
column_name SMALLMONEY
Usage
SMALLMONEY has a smaller range than MONEY, but both use four fractional decimal places. Microsoft warns that calculations with either type can incur truncation-related rounding errors; use DECIMAL with an appropriate precision and scale for currency arithmetic. See Microsoft’s MONEY and SMALLMONEY guidance.
Examples
Here are two examples of using the SMALLMONEY data type.
-
Creating a
salestable with apricecolumn for storing the sales unit price.CREATE TABLE sales ( id INT PRIMARY KEY, product_name VARCHAR(50), price SMALLMONEY ); -
Inserting data into the
salestable and querying the values in thepricecolumn.INSERT INTO sales (id, product_name, price) VALUES (1, 'Product A', 9.99), (2, 'Product B', 19.99); SELECT price FROM sales;The result is as follows:
price 9.9900 19.9900
Conclusion
SMALLMONEY stores a smaller range than MONEY but has the same four fractional decimal places. Because Microsoft warns of truncation-related rounding in calculations, use DECIMAL with a suitable precision and scale for currency arithmetic.