[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


int data type

Posted on 2007-10-04
Medium Priority
Last Modified: 2010-03-19
How many digits of number int data type can store?  I would to use int data type for record_key field which will have multi millions of records.. would int data type be enough for this ?
Question by:jung1975
LVL 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 400 total points
ID: 20014853
int tops out at about 2.1 billion, so you should be safe :)
LVL 27

Accepted Solution

ptjcb earned 600 total points
ID: 20014856
2GB - if you need to go higher than use bigint

From BOL


Has a length of 8 bytes and stores numbers from 2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807).

integer or int

Has a length of 4 bytes, and stores numbers from -2,147,483,648 through 2,147,483,647.


Has a length of 2 bytes, and stores numbers from -32,768 through 32,767.


Has a length of 1 byte, and stores numbers from 0 through 255.

LVL 16

Assisted Solution

SQL_SERVER_DBA earned 600 total points
ID: 20014857
On "32-bit" machines the int data type takes up 4 bytes (232). The short is usually smaller, the long can be larger or the same size as an int and finally the long long is for handling very large numbers.
LVL 10

Assisted Solution

rivusglobal earned 400 total points
ID: 20014859

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question