How to remove primary key from simple table | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to remove primary key from simple table

suppose we create table like create table emp( id int primary key , name char ( 50)); so we assign primary key to id coloum , then I want drop this key through query ... not through GUI in SQL server ..

11th Mar 2017, 6:05 AM
Shravan Sawant
Shravan Sawant - avatar
3 Answers
+ 1
ALTER TABLE emp DROP PRIMARY KEY
11th Mar 2017, 7:29 AM
Álvaro
+ 1
hiiii Alvaro .... we try this it's not working ... suppose we create new table and assign constraint like ... create table emp (id int constraint emp_pk primary key, name char (50)); then we can drop this constraint .. alter table emp drop constraint emp_pk your query not working ... we try this
11th Mar 2017, 7:46 AM
Shravan Sawant
Shravan Sawant - avatar
0
hii
11th Mar 2017, 7:42 AM
Shravan Sawant
Shravan Sawant - avatar