DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Want to drop PK Key and recreate on other columns

  1. #1
    Join Date
    Nov 2001
    Posts
    110

    Want to drop PK Key and recreate on other columns

    I am trying to drop a PRIMARY key constraint and recreate it on different columns. I am getting the error that I cannot drop the primary key constraint. How do I go about it other that recreating the table.
    Thanks.

  2. #2
    Join Date
    Oct 2002
    Posts
    807
    It'll help if you post the sqltext and error message.

    Use "alter table tabname drop constraint consname"

    or alter table..drop primary key;

  3. #3
    Join Date
    Mar 2004
    Location
    IA USA
    Posts
    257
    the primary key is referred by other columns as the foreign key?
    if so, u can not directly drop this primary key.

  4. #4
    Join Date
    Jan 2001
    Posts
    3,134
    Cascade?
    I remember when this place was cool.

  5. #5
    Join Date
    Oct 2002
    Posts
    807
    The thread initiator hasn't bothered to respond with details. Why bother second guessing his/her problem. I think it's sheer decency.

  6. #6
    Join Date
    Jul 2002
    Location
    Northampton, England
    Posts
    612
    You could disable the foriegn key constraints, and then you'll be able to drop it and re-create it...

Posting Permissions

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


Click Here to Expand Forum to Full Width