2. SQL Data Types : Data Types : Storage Formats of Data Types
 
Share this page                  
Storage Formats of Data Types
The following table describes how each data type is stored:
Data Type
Description
Range
CHAR
character
A string of 1 to maximum configured row size, but not exceeding 16,000 characters (32,000 bytes)
VARCHAR
character
A string of 1 to maximum configured row size, but not exceeding 16,000 characters (32,000 bytes)
NCHAR
Unicode
See CHAR data type.
NVARCHAR
Unicode
See VARCHAR data type.
TINYINT
1-byte integer
-128 to +127
SMALLINT
2-byte integer
-32,768 to +32,767
INTEGER
4-byte integer
-2,147,483,648 to +2,147,483,647
BIGINT
8-byte integer
-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807
DECIMAL
fixed-point exact numeric
Depends on precision and scale. Default is (5,0): -99999 to +99999. Maximum number of digits is 38.
FLOAT4
4-byte floating
‑3.402823e+38 to +3.402823+38 (7 digit precision)
FLOAT or FLOAT8
8-byte floating
-1.0e+308 to 1.0e+308 (15 digit precision)
ANSIDATE
4-byte integer
0001-01-01 to 9999-12-31
TIME
2- or 4-byte integer
00:00:00 to 23:59:59.999999
TIMESTAMP
8-byte integer
0001-01-01 00:00:00 to
9999-12-31 23:59:59.999999999
INTERVAL YEAR TO MONTH
4-byte integer
-9999-11 to 9999-11
INTERVAL DAY TO SECOND
8-byte integer
-3652047 23:59:59.999999 to
3652047 23:59:59.999999
MONEY
money (8 bytes)
$-999,999,999,999.99 to $999,999,999,999.99
IPV4
4-byte binary
0.0.0.0 to 255.255.255.255
IPV6
16-byte binary
:: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
UUID
128-bit integer
00000000-0000-0000-0000-000000000000 to FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF
BOOLEAN
1-byte binary
0 or 1
Nullable columns require one additional byte to store a null indicator.
Note:  If your hardware supports the IEEE standard for floating point numbers, the FLOAT type is accurate to 14 decimal precision (-dddddddddddd.dd to +dddddddddddd.dd) and ranges from -10**308 to +10**308. The money type is accurate to 14 decimal precision with or without IEEE support.