-
Junior Member
How to alter the primary column
Alter perform on primary key column please give me the query for how to alter the primary column from the table.
-
Expert Member
Re: How to alter the primary column
Through Alter command we can add or drop primary key
examples
ALTER TABLE emp
ADD CONSTRAINT empno_pk PRIMARY KEY (empno);
To add primary key to existing table ,we must take care that primary key column field(fields) must be not null and not duplicate.
To Drop primary key:
alter table emp
drop constraint empno_pk
-
Re: How to alter the primary column
To drop the primary key can also use
alter table table_name drop primary key;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules