Log in

View Full Version : DB : ID attribution question


KhaN
05-21-2004, 05:26 AM
It look like DB always remember what ID is needed. Like if my last ID is 46 in "NPC_TYPE", i spawn 4 mobs, then i want to remove one. DB wont attrib ID 49, but 50. Is there a way to fix this ? so DB will attrib ID next to the last one ? ... humm i wonder if its clear.

Derision
05-21-2004, 05:50 AM
I was perusing the mysql documentation and:

ALTER TABLE tbl_name AUTO_INCREMENT = value

might be what you want, e.g.

ALTER TABLE npc_types AUTO_INCREMENT=49;

I've not tried it, and I would backup your db first if you do plan on trying it, just to be on the safe side :)

KhaN
05-21-2004, 07:42 AM
Thanks Derision, it work perfectly :)