You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exact-number data types that use integer data. To save space in the database, use the smallest data type that can reliably contain all possible values. For example, tinyint would be sufficient for a person's age because no one lives to be more than 255 years old. But tinyint would not be sufficient for a building's age because a building can be more than 255 years old.
33
33
34
-
|Data type|Range|Storage|
35
-
|---|---|---|
36
-
|**bigint**|-2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807)|8 Bytes|
37
-
|**int**|-2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647)|4 Bytes|
38
-
|**smallint**|-2^15 (-32,768) to 2^15-1 (32,767)|2 Bytes|
39
-
|**tinyint**|2^0-1 (0) to 2^8-1 (255)|1 Byte|
34
+
|Data type|Range|Range expression|Storage|
35
+
|---|---|---|---|
36
+
|**bigint**|-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807| -2^63 to 2^63-1 |8 Bytes|
37
+
|**int**|-2,147,483,648 to 2,147,483,647|-2^31 to 2^31-1 |4 Bytes|
38
+
|**smallint**|-32,768 to 32,767 |-2^15 to 2^15-1 |2 Bytes|
39
+
|**tinyint**| 0 to 255 |2^0-1 to 2^8-1 |1 Byte|
40
40
41
41
## Remarks
42
42
The **int** data type is the primary integer data type in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. The **bigint** data type is intended for use when integer values might exceed the range that is supported by the **int** data type.
0 commit comments