Alter Table Drop Primary Key. Iv How to drop a primary key in SQL. Following is the query to drop a primary key in MySQL.
ALTER TABLE name DROP PRIMARY KEY. Listed below is an example of the SQL generated by the PostgreSQL Alter Table Drop Primary Key function. To modify a primary key execute an ALTER TABLEDROP PRIMARY KEY statement to drop the existing primary key and then execute an ALTER TABLEALTER column-name column-alteration statement to set the new primary key for the table.
A primary key definition is added to the table definition in the database.
Iv How to drop a primary key in SQL. ALTER TABLE test DROP PRIMARY KEY DROP INDEX. Important Note You cannot drop a primary key or unique key constraint that is part of a referential integrity constraint without also dropping the foreign key. The logic is duplicated differently in row_log_table_low where ventry is replaced with NULL.