Turn existing column into a primary key
sql, sql-server
Solution
ALTER TABLE emp
ADD PRIMARY KEY (emp_id)
OR
ALTER TABLE emp
ADD CONSTRAINT pk_empID PRIMARY KEY (emp_id)
Problem
``` create table emp ( emp_id int, emp_name varchar(40) not null, emp_address varchar(35) not null, ) ``` Now I need to add primary key to emp_id . I tried using alter query ``` alter table emp add constraint emp_id primary key ``` its showing error as Table level constraint does not specify column list, table 'emp'.