|
-
Apr 14th, 2010, 03:59 AM
#1
Thread Starter
New Member
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?
-
Apr 14th, 2010, 04:17 AM
#2
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/
-
Apr 14th, 2010, 05:37 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|