Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Query related to Identity column

Author  Topic 

shubhada
Posting Yak Master

117 Posts

Posted - 2006-02-13 : 05:30:44
What is the maximum number of rows I can insert in my table when my table have auto incremented column (Identity Column)?

shubhada

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-02-13 : 05:57:09
an int value has a precision of 10 and bigint precision of 19, so that might answer your question.

Afrika
Go to Top of Page

mmarovic
Aged Yak Warrior

518 Posts

Posted - 2006-02-13 : 07:19:30
tinyInt: 2**8 = 256 because it is actually uusigned int. All other int types: 2**(<bits number>-1). It means:
smallInt: 2**15
int: 2**31
bigInt: 2**63
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-02-13 : 07:23:12
quote:
Originally posted by shubhada

What is the maximum number of rows I can insert in my table when my table have auto incremented column (Identity Column)?

shubhada


It depends on the datatype of that identity column. Generally int datatype is enough. If you think your table will have billions of rows, then bigint is the one you have to choose.

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-02-13 : 07:29:48
maybe you shoudl read books online

for bigint, see below


quote:
Using the bigint Data Type
The bigint data type is an integer containing values from -2^63 (-9,223,372,036,854,775,807) through 2^63-1 (9,223,372,036,854,775,807). The storage size is 8 bytes.

Go to Top of Page

mmarovic
Aged Yak Warrior

518 Posts

Posted - 2006-02-13 : 07:39:48
quote:
Originally posted by mmarovic

tinyInt: 2**8 = 256 because it is actually uusigned int. All other int types: 2**(<bits number>-1). It means:
smallInt: 2**15
int: 2**31
bigInt: 2**63

I mean when identity seed = 0 and increment = 1.
Go to Top of Page
   

- Advertisement -