I have a composite primary key made up of 2 foreign keys and a primary key. I need to drop the single primary key (in this case "page_num") but I cannot figure out how to do it and there's no documentation at mysql.com.
Any ideas?
| SitePoint Sponsor |
I have a composite primary key made up of 2 foreign keys and a primary key. I need to drop the single primary key (in this case "page_num") but I cannot figure out how to do it and there's no documentation at mysql.com.
Any ideas?
ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC





Hi,
Perhaps this could be what you're looking for?
Code:ALTER TABLE tbl_name DROP PRIMARY KEY, ADD PRIMARY KEY (first_field, second_field);
ERIK RIKLUND :: Yes, I've been gone quite a while.
Nope. I get an error as it's trying to "rename tables"...
ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC





Hi,
I just tried the query on a simple test table, and it worked for me...
ERIK RIKLUND :: Yes, I've been gone quite a while.
It didn't work but I figured out a way to do it... The foreign keys were keeping it from being dropped.
ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
Bookmarks