Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Help! Copied Table But Lost Autoincrement

forums forums SQLyog Using SQLyog Help! Copied Table But Lost Autoincrement

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #12366
      Larry Woods
      Member

      I used the “Duplicate Table” feature in order to make a copy of a table. I then needed to restore the original table. That is when I discovered that the copy had not preserved the Autoincrement feature of my index. When I tried to reset it I got a message “Invalid default value for 'ID'” which is my index field.

      I am totally screwed!!

      P.S. Sorry if this is a duplicate message. I hit the wrong key and I don't know if the first one went through.

    • #32369
      ashwin
      Member

      Hi,

      Quote:
      When I tried to reset it I got a message “Invalid default value for 'ID'” which is my index field

      Auto-increment column must be indexed, and it cannot have a DEFAULT value. Refer http://dev.mysql.com/doc/refman/5.6/en/create-table.html

      If you enable the option “With Indexes” in “Duplicate Table” then the Auto-increment column will be indexed. Please check this option as shown in the attached image.

      Thanks,

      Ashwin A

Viewing 1 reply thread
  • You must be logged in to reply to this topic.