views:

33

answers:

1

What could be the Consequence of inserting "id" in any autoincrementing 'id' containing table?

If I have a Tabe in which I have configured the column "id" as the auto incrmented, But still I am using an INSERT query in which id is defined, like wise INSERT INTO XYZ (id) values ('26'); How does it going to effect the table and the process related to it.. Is it "no issues" to do this? or it should be avoided?

+1  A: 

You can do this if you need to. The table keeps track of what the AUTO_INCREMENT number is at, and if you insert a number equal to or higher than this number, then MySQL adjusts the AUTO_INCREMENT value appropriately.

Basically, inserts always start from the highest auto_increment id + 1, and you can insert specific ids with no problems.

zombat
Dont U Think that Problem Could be in the case when two tables of similar structures needs to be synchronized?
OM The Eternity