GetDotted Domains

Viewing Thread:
"Okay, who is familiar with SQL and/or Interbase?"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Thu 16/05/02 at 16:32
Regular
Posts: 787
How the hell do I change the primary key on a table?
Thu 16/05/02 at 17:06
Regular
""
Posts: 303
Drop it...
ALTER TABLE DROP PRIMARY KEY DROP CONSTRAINT

Add a new one...
ALTER TABLE ADD CONSTRAINT PRIMARY KEY ()

You'll have to drop foreign keys on other tables that reference the column first though.
Thu 16/05/02 at 16:54
Regular
"smile, it's free"
Posts: 6,460
I created a table, and I've realised the primary key is wrong.

If it can't be changed, that is very gay. The user should have ultimate control. The system does not know best.

I know if I'd set it up as a constraint I could drop the constraint, but I didn't. I need to find some other way to drop the existing primary key, then I can set a new one.

The table metadata looks like this

* Table: CALENDER, Owner: SYSDBA */

CREATE TABLE "CALENDER"
(
"PROGRAMME_ID" "PROGRAMME_ID" NOT NULL,
"MODULE_ID" "MODULE_ID" NOT NULL,
"OPTIONALITY" "OPTIONALITY",
PRIMARY KEY ("PROGRAMME_ID")
);



I don't want Programme_ID as the primary key.....
Thu 16/05/02 at 16:50
Regular
"Picking a winner!"
Posts: 8,502
Are you creating a table from scratch or using a pre-created one. You can't change it I don't think if you have already set it up as it would cause problems. I have never used the program before but used MS Access and I know you pick the primary key when you are setting it up and can't change it after that.
Thu 16/05/02 at 16:32
Regular
"smile, it's free"
Posts: 6,460
How the hell do I change the primary key on a table?

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Thank you very much for your help!
Top service for free - excellent - thank you very much for your help.
Top-notch internet service
Excellent internet service and customer service. Top-notch in replying to my comments.
Duncan

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.