Tema: resetear id
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/08/2006, 09:21
Avatar de Belero
Belero
 
Fecha de Ingreso: agosto-2006
Mensajes: 98
Antigüedad: 17 años, 7 meses
Puntos: 0
Pone el siguiente auto_increment a introducir el valor que tu le digas, veamos con un ejemplo sencillo

Tenemos 6 registros id seguidos
1 - 2 - 3 - 4 - 5 - 6

Borramos el número 5
1 - 2 - 3 - 4 - 6

Introducimos otro
1 - 2 - 3 - 4 - 6 - 7

Queremos que vuelva a existir el 5
ALTER TABLE nombre_tabla AUTO_INCREMENT=5

Introducimos otro
1 - 2 - 3 - 4 - 5 - 6 - 7