I have seen in most of the forums putting my sql command instead of sql command to remove primary key constraint. Please don't get confused between MySql and Sql commands as both are different from each other. Let's see how to remove primary key constraint from the table.
Every table must have a primary key definition. This can be single or group of two or more, I mean composite primary key. For more details on composite primary key please click on the link. Let's see how to delete a primary key from a table.
We use alter and drop command to delete primary key constraint. Let's create one first then we will delete that. I am creating a table and adding primary key to it. For more details on how to add a primary key please click on this link.
Let's create a table and add primary key constraint and name it PK_ID.
CREATE TABLE MyTable(ID int not null, FirstName varchar(50), LastName varchar(50), CONSTRAINT PK_ID PRIMARY KEY (ID))
Now let's try to delete it. For this you can use alter command.
ALTER TABLE MyTable DROP CONSTRAINT PK_ID
If you have not specified primary key name while creating your table, you can check its name in key section also. Please see the image. You can find your here.
Hope it helps you. Use it in your code and enjoy.