Wednesday, September 17, 2008

What's the difference between TINYINT, SMALLINT, INT and BIGINT DataType In SQL SERVER

This datatype same is type but the differ from storage type,min and max values, the details as follows,

Data Type Min Value Max Value Storage Size
tinyint 0 255 1 byte
smallint -2^15 (-32,768) 2^15 - 1 (32,767) 2 bytes
int -2^31 (-2,147,483,648) 2^31 - 1 (2,147,483,647) 4 bytes
bigint -2^63 (-9,223,372,036,854,775,808) 2^63 - 1 (9,223,372,036,854,775,807) 8 bytes

No comments: