SQL Language Guide > SQL Language Guide > Data Types > Data Types > Storage Formats of Data Types
Was this helpful?
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, 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.
Last modified date: 03/21/2024