Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    67

    Unanswered: Change Primary Key

    Hi,

    How do i change the primary key of my table
    I have 2 columns that are currently the primary key
    I need a third column also to be a part of the Primary key (Composite Primary key)

    Can someone provide me the SQL for the same

    Thanks
    Shankar

  2. #2
    Join Date
    Feb 2004
    Posts
    108

  3. #3
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Alter table x
    drop constraint pk / drop primary key

    Alter table x
    add constraint pk PRIMARY KEY (a, b, c) / add primary key (a, b, c);
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •