Answers for "add on delete cascade to existing foreign key"

1

add on delete cascade to existing foreign key

ALTER TABLE TABLEName
drop CONSTRAINT FK_CONSTRAINTNAME;

ALTER TABLE TABLENAME
ADD CONSTRAINT FK_CONSTRAINTNAME
    FOREIGN KEY (FId)
    REFERENCES OTHERTABLE
        (Id)
    ON DELETE CASCADE ON UPDATE NO ACTION;
Posted by: Guest on July-16-2021

Code answers related to "add on delete cascade to existing foreign key"

Browse Popular Code Answers by Language