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

Thread: Primary key

  1. #1
    Join Date
    Jul 2001
    Posts
    181

    Primary key

    I have a table which has duplicate values within it. I now need to put a primary key on this column, but obviously am unable too. Can anyone give me an idea on how I can achive this without losing the data and also to be able to put a primary key on it.

    Something like copying to a temp table etc etc

    Thanks in advance


    Marlon..

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    You can use a sequence to create a new primary key and then add a unique index with novalidate to stop anymore duplicate values from being entered. You can lso combine the field with the duplicates with another field and make a concatenated key based on both fields.

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