List of all data types offered by SQL server:
Category | Type | Name | bytes | Description | Example |
---|---|---|---|---|---|
Numeric | TINYINT | 1 | Always unsigned, integer data from 0 through 255 | ||
Numeric | SMALLINT | 2 | Integer data from -2^15 (-32,768) through 2^15 - 1 (32,767) | ||
Numeric | INT | 4 | Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647). | ||
Numeric | BIGINT | 8 | Integer (whole number) data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). | ||
Numeric | FLOAT | 8 | double precision: -1.79E + 308 through -2.23E - 308, 0 and 2.23E + 308 through 1.79E + 308 | ||
Numeric | REAL | -3.40E + 38 through -1.18E - 38, 0 and 1.18E - 38 through 3.40E + 38. | |||
Numeric | Fixed precision (p) and scale (s) number | DECIMAL(p, s) NUMERIC(p, s) where p = 38, 0 = s = p |
Fixed precision and scale numeric data from -10^38 +1 through 10^38 –1 | ||
Numeric | MONEY | Monetary data values from -2^63 (-922,337,203,685,477.5808) through 2^63 - 1 (+922,337,203,685,477.5807), with accuracy to a ten-thousandth of a monetary unit. | |||
Numeric | SMALLMONEY | Monetary data values from -214,748.3648 through +214,748.3647, with accuracy to a ten-thousandth of a monetary unit. | |||
Boolean | BIT | Integer data with either a 1 or 0 value | |||
Character | Variable-length with limit | VARCHAR(n) NVARCHAR(n) |
|||
Character | Fixed-length, blank padded string | CHAR(n) NCHAR(n) |
|||
Character | TEXT | TEXT / NTEXT VARCHAR(MAX) / NVARCHAR(MAX) |
|||
Character | CHAR | Fixed-length non-Unicode character data with a maximum length of 8,000 characters. | |||
Character | VARCHAR | Variable-length non-Unicode data with a maximum of 8,000 characters. | |||
Character | TEXT | Variable-length non-Unicode data with a maximum length of 2^31 - 1 (2,147,483,647) characters. | |||
Character | NCHAR | Fixed-length Unicode data with a maximum length of 4,000 characters | |||
Character | NVARCHAR | Variable-length Unicode data with a maximum length of 4,000 characters | |||
Character | NTEXT | Variable-length Unicode data with a maximum length of 2^30 - 1 (1,073,741,823) characters. | |||
Binary | BINARY | Fixed-length binary data with a maximum length of 8,000 bytes | |||
Binary | VARBINARY | Variable-length binary data with a maximum length of 8,000 bytes | |||
Binary | IMAGE | Variable-length binary data with a maximum length of 2^31 - 1 (2,147,483,647) bytes | |||
Date and time | DATETIME | 8 | Date and time data from January 1, 1753, through December 31, 9999, with an accuracy of three-hundredths of a second, or 3.33 milliseconds | ||
Date and time | SMALLDATETIME | 4 | Date and time data from January 1, 1900, through June 6, 2079, with an accuracy of one minute. | ||
Large object | Character LOBs | TEXT / NTEXT VARCHAR(MAX) / NVARCHAR(MAX) |
|||
Large object | Binary LOBs | IMAGE VARBINARY(MAX) |
|||
UUID | UNIQUEIDENTIFIER | ||||
XML | XML | ||||
any | SQL_VARIANT |