Easier than that (though Sheeri's way would work):
ALTER TABLE yourtablename DISABLE KEYS;
... do your processing ...
ALTER TABLE yourtablename ENABLE KEYS;
Unimin Corporation - Spruce Pine
"sheeri kritzer" <awfief@stripped> wrote on 02/20/2006 12:28:54 PM:
> Drop the keys and references, change it, and then re-create the keys
> and references.
> (a SHOW CREATE TABLE will show you the constraints including foreign
> keys -- copy those, so you can create them later. Then you can use
> ALTER TABLE to drop the keys, change your columns, and then you can
> use ALTER TABLE to add the keys back in, although it sounds like you
> won't have a primary key in the new table).
> On 2/17/06, Tomáš Vichta <tomas.vichta@stripped> wrote:
> > Hello,
> > I need to turn off all constraints in a table (especially primary and
> > foreign keys) - because for example I need to exchange primary key
> > values of two rows in a table. And because of primary key constraints
> > can do it directly. I would to turn off the constraint, rename value
> > PK1 to PK2 - now I have the same 2 values PK2 and it's the problem, if
> > the primary key constraint is enabled.
> > Thanx very much for answer, TV.
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe: http://lists.mysql.com/mysql?unsub=1ief@stripped
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=sgreen@stripped