How do you drop primary key?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How do you drop primary key?

Postby Granpoh » 24. August 2008 21:31

Thanks for all assistance.
Granpoh
 
Posts: 39
Joined: 27. April 2008 10:23

Postby Dave_L » 25. August 2008 10:39

I didn't have any problem dropping a primary key.

How are you doing it, and what happens when you try?
User avatar
Dave_L
 
Posts: 212
Joined: 23. October 2004 00:43

Postby Granpoh » 25. August 2008 15:33

I've done nothing. I don't know how to do it. That's what I need to know, is how?

Thanks
Granpoh
 
Posts: 39
Joined: 27. April 2008 10:23

Postby Nobbie » 25. August 2008 15:41

What do you want? Do you want to drop the primary key "attribute" (and keep the column and values), or do you want to drop the whole column including the values?

a) Drop key, keep column:

ALTER TABLE `tablename` DROP PRIMARY KEY


b) Drop whole column:

ALTER TABLE `tablename` DROP `columnname`
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Postby Granpoh » 25. August 2008 15:59

Hello,

I just need to drop the primary key attribute, not the column. I guess the only way to do it is with SQL coding, and not with some sort of clickable icon, etc. right?

Thanks
Granpoh
 
Posts: 39
Joined: 27. April 2008 10:23

Postby Nobbie » 25. August 2008 17:03

> I guess the only way to do it is with SQL coding, and not with some sort of clickable icon, etc. right?

Wrong guess.

You can use phpmyadmin to work with SQL Tables by clicking on icons etc.

PhpMyAdmin is part of the Xampp installation.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Postby Granpoh » 25. August 2008 19:47

Nobbie wrote:Wrong guess.

You can use phpmyadmin to work with SQL Tables by clicking on icons etc.

PhpMyAdmin is part of the Xampp installation.



Hello,

I just mean that for that particular function, i.e. "dropping a primary key attribute", there doesn't seem to be a clickable icon that brings about that goal. I mean, I went to the column that I wanted do drop the primary key I had accidentally set and clicked the primary key icon, thinking that by clicking it again, it would perhaps drop the key, or at least give me an option to drop it, but when I do that, it doesn't actually drop it, but, instead, drops it only to create a new one.

Thanks
Granpoh
 
Posts: 39
Joined: 27. April 2008 10:23

Postby Dave_L » 25. August 2008 19:52

In phpMyAdmin, on the Structure page for a database table, there's an Indexes box in the lower left. Click the X icon next to the primary key to drop it.

Image
User avatar
Dave_L
 
Posts: 212
Joined: 23. October 2004 00:43

Postby Granpoh » 25. August 2008 20:09

Dave_L wrote:In phpMyAdmin, on the Structure page for a database table, there's an Indexes box in the lower left. Click the X icon next to the primary key to drop it.

Image


That's EXACTLY what I was looking for! (I'm just a noob)

Thanks for all the help Dave and Nobbie.
Granpoh
 
Posts: 39
Joined: 27. April 2008 10:23


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 138 guests