SQL Server Data Types Flashcards
BIGINT Storage Size
8 Bytes
BIGINT Range
-2^63 ≤ bi ≤ 2^62
BIGINT Type
Exact
INT Storage Size
4 Bytes
INT Range
-2,147,483,648 ≤ int ≤ 2,147,483,647
INT Type
Exact
TINYINT Storage Size
1 Byte
TINYINT Range
0 ≤ ti ≤ 255
TINYINT Type
Exact
BIT Range
0 to 1
BIT Storage Size
1 - 8 BIT cols in same tbl = 1 byte
9-16 BIT cols in same tbl = 2 byte
etc…
BIT Type
Exact
NUMERIC(p,s) / DECIMAL(p,s) Storage Size
p = precision
s = scale
p 1-9 = 5 bytes
p 10-19 = 9 bytes
p 20-28 = 13 bytes
p 29-38 = 17 bytes
NUMERIC(p,s) / DECIMAL(p,s) Range
-10^38 ≤ n ≤ 10^37
NUMERIC(p,s) / DECIMAL(p,s) Type
Exact
MONEY Storage Size
8 Bytes
MONEY Range
-2^59 ≤ m ≤ 2^58
MONEY Type
Exact
SMALLMONEY Storage Size
4 Bytes
SMALLMONEY Range
-214,748.3648 ≤ sm ≤ 214,748.3647
SMALLMONEY Type
Exact
FLOAT Storage Size
00 ≤ p ≤ 24 : 4 Bytes
25 ≤ p ≤ 53 : 8 Bytes
FLOAT Range
-1.79E +308 ≤ f ≤ 1.79E +308
FLOAT Type
Approx.
REAL Storage Size
4 Bytes
REAL Range
-3.40E +38 ≤ r ≤ 3.40E +38
REAL Type
Approx.
DATETIME Storage Size
8 Bytes
DATETIME Range
1753-01-01 ≤ dt ≤ 9999-12-31
DATETIME Type
Datetime
SMALLDATETIME Storage Size
4 Bytes
SMALLDATETIME Range
1900-01-01 ≤ sdt ≤ 2079-12-31