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



Guides


vsn 3.1