Data Category | Data Type | Size | Value Range |
Exact Numaric |
Bit | 1 | 1,0 or Null |
Tinyint | 1 | 0 to 255 | |
smallint | 2 | -2^15 (-32,768) to 2^15-1 (32,767) | |
Int | 4 | -2^31 (-2,147,483,648) to 2^31-1
(2,147,483,647) |
|
Bigint | 8 | -2^63 (-9,223,372,036,854,775,808) to 2^63-1
(9,223,372,036,854,775,807) |
|
smallmoney | 4 | -214,748,3648 to 214,748,3647 | |
Money | 8 | -922,337,203,685,477,5808 to
922,337,203,685,477,5807 |
|
Numaric[(p[,s])] | 5-17 | ||
Decimal[(p[,s])] | 5-17 | ||
Approximate Numeric |
Float | 4-8 | -1.79E+308 to -2.23E-308, 0 and 2.23E-308 to
1.79E+308 |
Real/float(24) | 4 | -3.40E +38 to -1.18E-38,0 and 1.18E-38 to
3.40E+38 |
|
Character Strings |
char[(N)] | N | |
varchar[(N or max)] | N or 2^31-1 | N = 1 to 8000 non-Unicode characters bytes
Max=2^31-1 bytes (2 GB) non-Unicode |
|
Text | 2^31-1 | 1 t0 2^31-1 (2,147,483,647) non-Unicode
characters bytes |
|
unicode character strings |
nchar[(N)] | N | N = 1 to 4000 UNICODE UCS-2 bytes |
nvarchar[(N|max)] | N or 2^31-1 | N = 1 to 4000 UNICODE UCS-2 bytes
1 to 2^31-1 (2,147,483,647) UNICODE |
|
Ntext | 2^31-1 | Maximam size 2^30-1 (1,073,741,823) bytes | |
Binary strings |
binary[(N)] | N | N = 1 to 8000 bytes |
varbinary[(N|max)] | N or 2^31-1 | N = 1 to 8000 bytes Max = 0 to 2^31-1 bytes | |
Image | 2^31-1 | 0 to 2^31-1 (2,147,483,647) bytes | |
other data types |
Uniqueidentifier | 16 | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx(hex
decimal) |
Timestamp | 8 | binary(8) or varbinary(8) | |
rowversion | 8 | binary(8) or varbinary(8) | |
xml | 2^31-1 | xml([CONTENT|
DOCUMENT]xml_scheme_collection) |
|
sql_variant | 8016 | data type that stores values of various SQL
Server -supported data types |
|
Hierarchyid | 892 | 6*logAn bits where n is child node | |
Cursor | |||
Table | |||
Sysname | 256 |
Date & Time |
Date | 3 | 0001-01-01 through 9999-12-31 |
time[(fractional
second precision)] |
3 to 5 | 00:00:00.0000000 through 23:59:59.9999999 | |
Smalldatetime | 4 | Date: 1900-01-01 through 2079-06-06
Time: 00:00:00 through 23:59:59 |
|
Datetime | 8 | Date: January 1,1753, through December
31,9999 Time: 00:00:00 through |
|
datetime 2 [(
fractional secounds |
6 to 8 | Date: 0001-01-01 through 9999-12-31
Time: 00:00:00 through |
|
datetimeoffset [(fractional
secounds |
8 to 10 |
Date: 0001-01-01 through 9999-12-31
Time: 00:00:00 through 23:59:59.9999999 |
|
Spatial | Geography | 2^31-1 | |
Geometry | 2^31-1 |