#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Evergreen Colorado
    Posts
    2
    Rep Power
    0

    Identity not incrementing sequencially


    I am looking at a key field set with an auto incrementing identity.

    after several inserts from our web form there are gaps in identy number generated. Sometime there are gaps of 2 other times there are gaps of 4.

    example if you were to cycle through the identities it goes 13, 14, 17, 18 -- 15 and 16 are missing.

    any idea how this could occur?

    I have checked logs and found no indication of errors but may not have looked everywhere I need to.

    Any suggestions as to where to look for possibly lost inserts as well as a clue as to how it happens would be appreciated!

    Thanks!

    ESD
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,441
    Rep Power
    4539
    I used to live in Kittredge. Is the Little Bear still around?

    The likeliest reason for missing identity values is if your code started an insert but didn't finish it, or if a record is deleted after it's inserted.

    The identity value won't "back up" to use staggered values.

    My recommendation is don't worry about it. Typically an autonumber/identity is nothing but a unique record identifier and shouldn't have any other significance other than it's uniqueness. If you absolutely positively need sequential numbers you might look at an additional column that gets it's value from some process you can control.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Evergreen Colorado
    Posts
    2
    Rep Power
    0
    When did you leave Kittredge?

    The Little Bear is still there hoppin like usual. I think the best seats are still just up above the band, just remember the earplugs!

    I kinda thought that was what was happening with the inserts since there is no way for users to delete records. I just needed some reassurance =-))

    thanks for the reply.
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,441
    Rep Power
    4539
    It's been almost 20 years ago now. I was there for the big blizzard of 1982, snowed in for 1 week! I fondly remember taking maybe 10 minutes to get across the room at the LB. I was there one night when Willie Nelson dropped in and played for a while. This was back before the IRS took his Evergreen ranch.

IMN logo majestic logo threadwatch logo seochat tools logo