Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Lucas Gump
August 7, 2005, 3:09 am
rate this thread
multiple primary key defined?
I have to change sp_id, so_id as primary keys to the existing primary
dn_slot_id and dn_mm_id.
I tried several times but all failed:
1. alter table debit_slot_detail add primary key (sp_id, so_id);
2. alter table debit_slot_detail add primary key (dn_slot_id, dn_mm_id,
thanks in advance for any help
Re: add primary keys to a table one-time and there are already
A table can have only one primary key (it counts as one if that key is a
"compound key" comprised of multiple columns in the table). To add a
new primary key, or change the columns that comprise the key, you have
to drop the old one first. There is another usage of ALTER TABLE for this.
- » reporting services equivelant in MySQL or PostGreSQL?
- — Next thread in » MySQL Database Forum
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum