Answers for "change constraint in sql"

SQL
0

alter constraint in sql

You can not alter constraints ever but you can drop them and then recreate.

Have look on this

    ALTER TABLE your_table DROP CONSTRAINT ACTIVEPROG_FKEY1;

and then recreate it with ON DELETE CASCADE like this

    ALTER TABLE your_table
    add CONSTRAINT ACTIVEPROG_FKEY1 FOREIGN KEY(ActiveProgCode) REFERENCES PROGRAM(ActiveProgCode)
        ON DELETE CASCADE;
hope this help
Posted by: Guest on May-20-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language