Numeric Datatypes

SQL Server has several datatypes to support numeric data. They can be broken into four groups:

  • Integers

  • Approximate numeric datatypes

  • Exact numeric datatypes

  • Money datatypes

Integer Datatypes

The integer datatypes—bigint, int, smallint, and tinyint—as their names imply, differ in the range of numbers they can store and the amount of storage they require. Integers are efficient to store, process, and present a wide range of unique values. This makes them ideal candidates when generating values for surrogate primary keys. Table 12.4 lists the storage requirements and capacities of the integer datatypes.

Table 12.4. Storing Integer Information
Integer Datatype Storage Size Minimum Value Maximum Value
tinyint 1 byte 0 255
smallint

Get Microsoft® SQL Server™ 2000 Unleashed, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.