SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,388
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Create two fields as PRIMARY KEY from existing table

    I forgot to designate the two rows in my linking table as PRIMARY KEY Item, Category when I created the table. I already entered the data in the table (called RdyLinkCat). What is the code to change the two fields? This comes from Kevin Yank's Database web site book on page 99.

    Thanks!
    Steve H

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,097
    Mentioned
    153 Post(s)
    Tagged
    3 Thread(s)
    ALTER TABLE RdyLinkCat ADD PRIMARY KEY(Item,Category)

    See http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

  3. #3
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,388
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Thank you very much!

    STeve


Bookmarks

Posting Permissions

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