Hello guys,

i have 5 records in my table.when i delete any record from the table i want to auto update record's id in my table.
ex.say 5 records from ID 1 to 5.when i delete record 3, the following records 4 n 5 id are changed from id 4 n 5 to 3 n 4 as i have deleted 3rd record .

expecting help from u guys.

thanks & regards

7 Years
Discussion Span
Last Post by dnanetwork

possible but besides your id something should be unique otherwise your update statement will never work.

and consider a case currently you are having 5 records and u r deleting record no 3..
so record no 4 & 5 gets updated..

but wot if in future you have more than 1 million records..now wot..?
can u imagine after a deletion of any record in between..
how many update statement will get fired in order to adjust your id..!

one more case wot if your id has references in child table..
then you have to update those references too..

wise option...take your time & Plan this whole thing again..
last question..why do u have such kind of requirement..!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.