Using Integer Data

Integers are whole numbers. They contain no decimals or fractions.

Microsoft® SQL Server™ has three sizes of integer data types:

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.

See Also
Numeric Data int, smallint, and tinyint

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.