alter constraint in sql

Solutions on MaxInterview for alter constraint in sql by the best coders in the world

showing results for - "alter constraint in sql"
Emilie
03 Feb 2018
1You can not alter constraints ever but you can drop them and then recreate.
2
3Have look on this
4
5    ALTER TABLE your_table DROP CONSTRAINT ACTIVEPROG_FKEY1;
6
7and then recreate it with ON DELETE CASCADE like this
8
9    ALTER TABLE your_table
10    add CONSTRAINT ACTIVEPROG_FKEY1 FOREIGN KEY(ActiveProgCode) REFERENCES PROGRAM(ActiveProgCode)
11        ON DELETE CASCADE;
12hope this help