Dofactory.com
Dofactory.com
Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

SQL SMALLMONEY Data Type

The SMALLMONEY data type holds monetary or currency values.

SMALLMONEY accepts values from -214,748.3648 to 214,748.3647.

A period is used to separate partial from whole monetary units like cents.

Example

#

A table with a SMALLMONEY column.

CREATE TABLE DemoTable  
( 
  Id INT IDENTITY, 
  EmployeeName VARCHAR(100),
  Salary SMALLMONEY
);
GO  

INSERT INTO DemoTable VALUES ('Harold Smith', 2150.77);  
INSERT INTO DemoTable VALUES ('Robert Johnson', 880);  
INSERT INTO DemoTable VALUES ('Janice Lopez', 1975.50);
INSERT INTO DemoTable VALUES ('Kelly Wilson', 1098.794); 
INSERT INTO DemoTable VALUES ('Grace Taylor', NULL); 
GO  

SELECT * FROM DemoTable;
GO

DROP TABLE DemoTable;
GO
Result:  5 records
Id EmployeeName Salary
1 Harold Smith 2150.77
2 Robert Johnson 880
3 Janice Lopez 1975.50
4 Kelly Wilson 1098.794
5 Grace Taylor NULL

More Examples

SMALLMONEY with OTHER MONETARY TYPES

This example displays the maximum values for SMALLMONEY and MONEY.
CREATE TABLE DemoTable  
( 
  MySmallMoney SMALLMONEY,
  MyMoney MONEY
);
GO  

INSERT INTO DemoTable VALUES (214748.3647, 922337203685477.5807);  
GO  

SELECT * FROM DemoTable;
GO

DROP TABLE DemoTable;
GO
Result:  1 record
MySmallMoney MyMoney
214748.3647 922337203685477.5807

You may also like



Last updated on Dec 21, 2023

Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.