SA-MP Forums Archive
SQLite/SQL - clear all "non-used" IDs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SQLite/SQL - clear all "non-used" IDs (/showthread.php?tid=622957)



SQLite/SQL - clear all "non-used" IDs - TheRohlikar - 28.11.2016

Hello...

I couldn't find a way...

I use "ID AUTO INCREMENT"... When I delete one of them, it skips deleted one and continues in other.

Explanation...

ID 1 - IDIOT, Admin level 4
ID 2 - IDIOT_2, Admin level 4
ID 3 - IDIOT_3, Admin level 4
ID 4 - IDIOT_4, Admin level 4

When I delete 'IDIOT_3' and add one again, it doesn't work like I want.. : (/adduser IDIOT_3 4)
It does...

ID 1 - IDIOT, Admin level 4
ID 2 - IDIOT_2, Admin level 4
ID 4 - IDIOT_4, Admin level 4
ID 5 - IDIOT_3, Admin level 4


Is there any way to keep database, but clear those "unusable ids" ?

Thanks, hope you understand.


Re: SQLite/SQL - clear all "non-used" IDs - Stinged - 28.11.2016

That's how AUTO_INCREMENT works. It doesn't re-use deleted indexes, it just adds one to the last value.