PDA

View Full Version : Next Autoindex


nerhael
07-18-2003, 03:22 PM
Is there a way to reset the value of the next autoindex for a table? Short of dropping all data, and pulling it back in.

Basically, I fubared and inserted a row in the database, but on the wrong server. For accounting, I'd like that ID.

Pete.

raf
07-18-2003, 07:14 PM
Yes.
- Lock tabel for other users
sort the table by autonum asc
-delete autonum variabel
- create new autonum column with the same name as the old columnname
- unlock table

<edit> Don't do this if you have an 'on delete cascade' on that varable </edit>