Integers are whole numbers. They contain no decimals or fractions.
Microsoft® SQL Server™ has three sizes of integer data types:
Has a length of 4 bytes, and stores numbers from
-2,147,483,648 through 2,147,483,647.
Has a length of 2 bytes, and stores numbers from
-32,768 through 32,767.
Has a length of 1 byte, and stores numbers from 0 through 255.
Integer objects and expressions can be used with any mathematical operations. Any fractions generated by these operations are truncated, not rounded. For example, SELECT 5/3 returns a value of 1, not the value 2, which would return if the fractional result was rounded.
The integer data types are the only ones can be used with the IDENTITY property, which is an automatically incrementing number. The IDENTITY property is typically used to automatically generate unique identification numbers or primary keys.
Integer data does not need to be enclosed in single quotation marks like character or date and time data.
Numeric Data | int, smallint, and tinyint |