Jump to content
Fórum Script Brasil
  • 0

(Resolvido) Voltar o Contador do AutoIncrement


tércio fernandes

Question

2 answers to this question

Recommended Posts

  • 0

Execute o teste abaixo e adapte a sua solução:

CREATE TABLE teste(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
ds VARCHAR(6),
PRIMARY KEY(id)
)ENGINE=MYISAM;
INSERT INTO teste(id,ds)
VALUES (1,a),(2,a),(3,a),(4,a),(5,a),(6,a),(7,a),(8,a),(9,a),(100,a);
UPDATE teste
SET id=10
WHERE id=100;
ALTER TABLE teste
AUTO_INCREMENT=10;
INSERT INTO teste(ds)
VALUES(b);

O ID ficará com 11.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...