Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    1

    Unanswered: help with alter table statement

    I'm trying to modify a primary key that already exists. I need to add another field to that primary key constraint. What would the syntax be?

    currently:
    primary key (product, location) constraint prodloc1

  2. #2
    Join Date
    Aug 2003
    Location
    India
    Posts
    262

    Re: help with alter table statement

    Originally posted by punchbowl
    I'm trying to modify a primary key that already exists. I need to add another field to that primary key constraint. What would the syntax be?

    currently:
    primary key (product, location) constraint prodloc1
    Hi there,

    First you will have to drop the existing constraint & then create a new one.

    Alter table <tabname>
    drop constraint prodloc1;

    Alter table <tabname>
    add constraint primary key (column1, column2);


    Regards,

    Lloyd

Posting Permissions

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