Jump to content

Edit History

phinq1910

phinq1910

You have to turn off identity insert, insert the records then turn on identity insert back. 

Example:

ALTER TABLE ps_product DROP PRIMARY KEY,
MODIFY id_product INT PRIMARY KEY NOT NULL;

--insert commmand here....

ALTER TABLE ps_product DROP PRIMARY KEY,
MODIFY id_product INT AUTO_INCREMENT PRIMARY KEY NOT NULL;

 

phinq1910

phinq1910

You have to turn off identity insert, insert the records then turn on identity insert back. 

Example:

ALTER TABLE ps_product DROP PRIMARY KEY,
MODIFY _id INT PRIMARY KEY NOT NULL;

--insert commmand here....

ALTER TABLE ps_product DROP PRIMARY KEY,
MODIFY _id INT AUTO_INCREMENT PRIMARY KEY NOT NULL;

 

×
×
  • Create New...