Results 1 to 3 of 3

Thread: Problem with addition of new record in the table a sql-server

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    1

    Problem with addition of new record in the table a sql-server

    Help, please. At me such problem.
    I work in VB 6.0. I in a sql-server 2000 have a table with column NUM with parametres:
    Allow Nulls - No
    Data Type - int
    Identity Specification - Yes
    Identity Increment - 1
    Identity Seed - 1
    Indexable - Yes
    At addition of new record column NUM should be filled automatically. I have added 10 records, column NUM was automatically filled with 1 on 10. But, as soon as I have removed all of them, and have started to add records, value NUM became 11 and above. And it is necessary to me that value was from that record, which goes next after removal (in my example if to remove all records, value NUM should begin with 1, if to remove to 5 records - that value following should be 6, etc.) In what a problem? How to solve this problem?

  2. #2
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,969

    Re: Problem with addition of new record in the table a sql-server

    SQL remembers the last value. To reset it look at Reseed in BOL or here:

    http://www.howtogeek.com/howto/datab...in-sql-server/

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Problem with addition of new record in the table a sql-server

    Welcome to VBForums

    Thread moved to 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)

    I recommend that you also read the article Why don't AutoNumber/Identity/etc re-use deleted numbers? from our Database Development FAQs/Tutorials (at the top of this forum)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width