Results 1 to 3 of 3

Thread: How to alter the primary column

  1. #1

    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.


  2. #2
    Expert Member
    Join Date
    Apr 2007
    Answers
    500

    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


  3. #3
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact