Tip of the Day : SQL Server Numeric Data Types

Welcome to SQL Server Helper !!!

This site is intended for those who are beginning to use SQL Server as part of their day-to-day activities.  You will find in this site a collection of useful functions, triggers, stored procedures and tips and tricks related to SQL Server.

Should you have any comments or questions regarding this site or if you want to ask SQL Server-related questions, e-mail us here.

We hope we are able to help and we are glad to help!!!

SQL Server Tip of the Day - February 17, 2020

SQL Server Numeric Data Types

SQL Server supports 9 different numeric data types; four data types that store integer values of various sizes, two data types that store monetary values, and four data types that store decimal-based numbers with varying accuracy. Here is a summary of the available numeric data types in SQL Server along with the range of values allowed together with the required storage space sorted according to the data type precedence from highest to lowest:

Data Type Data Range Storage Space
float –1.79308 to –2.23-308, 0, and 2.23-308 to 1.79308 4 bytes or 8 bytes
real –3.4038 to –1.18-38, 0, and 1.18-38 to 3.4038 4 bytes
decimal –1038 + 1 to 1038 – 1 5 to 17 bytes
money -922,337,203,685,477.5808 to 922,337,203,685,477.5807 8 bytes
smallmoney -214,748.3648 to 214,748.3647 4 bytes
bigint -263 (-9,223,372,036,854,775,808) to 263 - 1 (9,223,372,036,854,775,807) 8 bytes
int -231 (-2,147,483,648) to 231 - 1 (2,147,483,647) 4 bytes
smallint -215 (-32,768) to 215 – 1 (32,767) 2 bytes
tinyint 0 to 255 1 byte

SQL Server 2012

SQL Server 2008

User-Defined Functions

Date Functions

A collection of useful user-defined functions that deal with dates.

String Functions

A collection of useful user-defined functions that deal with strings (varchar/char/nvarchar/nchar).

Tree Functions

A collection of useful user-defined functions that deal with tree or hierarchical design structures.

Table-Valued Functions

A collection of useful table-valued user-defined functions that can be used to join with other tables.

SQL Server Built-in Functions

A reference to all built-in functions available within SQL Server grouped into categories.

Tips and Tricks

A collection of useful SQL Server-related tips and tricks:

SQL Server Error Messages

A list of SQL Server error messages and for certain error messages, discusses ways on how to solve the error or work around them:

Frequently Asked Questions