Changing the NOT NULL constraint

The NOT NULL constraint is a column-level data integrity constraint that prohibits writing NULL values. It ensures that the column always contains a valid value.

Dropping NOT NULL

DROP NOT NULL removes the NOT NULL constraint from the specified column.

For example, the following query will remove the NOT NULL constraint from column column_name in table table_name:

ALTER TABLE table_name ALTER COLUMN column_name DROP NOT NULL;

DROP NOT NULL can be applied to non-key columns in both row-oriented and column-oriented tables.

See also

Previous
Next