15.00 - Changing Column Attributes: NOT NULL/NULL - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

Changing Column Attributes: NOT NULL/NULL

Changing column attributes in ANSI SQL is restricted to setting or dropping a default clause.

To change the attributes of an existing column, the ALTER TABLE request must include the ADD keyword.

The following table summarizes the allowable cases for converting or adding NULL to NOT NULL, or NOT NULL to NULL columns.

 

WHEN you add this attribute to a column …

Composite changes are …

NULL

never permitted.

NOT NULL

permitted.

The following rules define how columns defined with NULL or NOT NULL attributes can be altered.

 

This column type …

When defined as …

Can be altered to this column type …

Indexed

NULL

NULL only

NOT NULL

NOT NULL only

Unindexed

NULL

NOT NULL

If and only if the column does not contain nulls.

NOT NULL

NULL