SQL Tutorial SQL Advanced SQL Database SQL References

SQL DROP DEFAULT Keyword



The SQL DROP DEFAULT keyword is used to delete a DEFAULT CONSTRAINT.

DROP DEFAULT constraint

To drop DEFAULT constraint from City column of Employee table, the SQL code is given below:

MySQL

ALTER TABLE Employee
ALTER City DROP DEFAULT;

OR

ALTER TABLE Employee
ALTER COLUMN City DROP DEFAULT;

SQL Server

/* Drops a DEFAULT constraint named DV_City */
ALTER TABLE Employee
DROP CONSTRAINT DV_City;

Oracle

ALTER TABLE Employee 
MODIFY City DEFAULT NULL;

❮ SQL Keywords