|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I used identity key in my table. The key is set to increment by 1. If I delete one record, the number will be deleted also. This action will left the number not in full sequence. for example "1,2,4,5,...". The number 3 is missing.
The question is whether the number 3 for the identity key will be reused by the new inserted record? If yes, then when it happen? |
|
#2
|
|||
|
|||
|
Nope, next record will be 6. You won't see another 3.
|
|
#3
|
|||
|
|||
|
What is the maximum number of the identity key, let said data type is integer? There must be a maximum number and the identity key will not increment anymore. At this time, do MSSQL Server 2000 will automatically reuse the deleted number to continue?
|
|
#4
|
||||
|
||||
|
all platforms have a limit on the size of a value you can store in a datatype. On a Wintel platform, an INT (2^31-1) is roughly 4 billion. Keep in mind, that this number starts from -2.1 billion. So essentially, if you start from 0, as most people do, you will only get 2.1 billion primary keys out of your int. Once you hit that limit, you will get an overflow error.
If you're just starting out programming, i would STRONGLY recommened reading up on datatypes before you jump in. re: "trying to fill the gaps": http://www.sqlteam.com/item.asp?ItemID=4123 |
|
#5
|
|||
|
|||
|
Thanks for the answer. Then there are a conclusion that MSSQL Server 2000 cannot automatically reused the identity key without interupt from human. Do I concluded right?
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Identity Key Reused |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|