0

How can I update the Number in Database Table which is have a Missing Sequence number on it using VB.NET?

For Example I Have a IDNumber on Item Master Tabel where there's a missing number and not sequence.

 Before             After
-------           ---------
   1                  1
   4                  2
   7    change to     3
   8       ==>        4
   9                  5
   15                 6
   21                 7
GaroPpo
  • 3
  • 8
  • https://stackoverflow.com/questions/21824478/reset-identity-seed-after-deleting-records-in-sql-server – traveler3468 Dec 04 '18 at 06:12
  • 1
    Why do you want to do this? It is an often-asked question but doing it is rarely a good idea. If there's a genuine need then so be it but most people want to do it just for appearances. If it's just an ID then that's all it needs to do, so the actual value is irrelevant. All that matters is that the values are unique and, in fact, changing the unique ID for a record is bad practice, because it then appears to be a different record after the change. – jmcilhinney Dec 04 '18 at 06:18
  • LMAO. Yes, Im the type of person that give more attention on appearances. It's actually not just for appereance. Just to give me current item that I have. For example my last ID number is 900, will make me think that I already have 900 items, and actually I have maybe arround 700 just because 200 item already deleted and the number keep going to 901, If i already delete arround 200 Items. – GaroPpo Dec 05 '18 at 15:23

0 Answers0