Integer Data Type | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Integer Data Type

Hi Everybody, I have small logical question related to Integer data type. When i create any column with data type as int,by default SQL take Length as 4 but when i have gone through BOL, it provide me the detail that Integer can take value from -2^31 to 2^31 i.e. can store 10 digit.
My question is why the difference in length ?. I am sorry to ask very basic question Thanks and Regards Ravi K
True and BOL also refers
Integer – Has a length of 4 bytes, and stores numbers from -2,147,483,648 through 2,147,483,647.

4 bytes doesn’t mean 4 digits the value referred is equivalent to 4 bytes. http://www.mssqlcity.com/Articles/General/choose_data_type.htm for information.
Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>