Answers for "sql alter column constraint"

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
1

sql alter column

Changes the data type of a table’s column.
Example: In the ‘users’ table, make the column ‘incept_date’ into a
‘datetime’ type.
ALTER TABLE users
ALTER COLUMN incept_date datetime;
Posted by: Guest on January-07-2021

Code answers related to "sql alter column constraint"

Code answers related to "SQL"

Browse Popular Code Answers by Language