remove ON DELETE CASCADE

Raghav picture Raghav · Oct 28, 2014 · Viewed 10.6k times · Source

I have a child table. and foreign key there with ON DELETE CASCADE while creating the table.

There are no records either in child or parent table.

I want the primary key, foreign key to be as they are but want to remove only the CASCADING option from the child table .

is there anyway that i can Alter that child table.

Thank you.

Answer

knkarthick24 picture knkarthick24 · Oct 28, 2014
ON DELETE { NO ACTION | CASCADE | SET NULL | SET DEFAULT }

The default is NO ACTION.

So try altering your child table back to default.