8. SQL Statements : ALTER TABLE
 
Share this page                  
ALTER TABLE
Valid in: SQL, ESQL, OpenAPI, ODBC, JDBC, .NET
The ALTER TABLE statement can be used to:
Add or remove a table-level constraint
Add or remove a column from a base table
Rename tables and columns. (For an alternative method of renaming tables, see Rename Table (see RENAME TABLE).) For information about rules and restrictions, see Rules and Restrictions on Renaming Tables (see Rules and Restrictions on Renaming Tables) and Rules and Restrictions on Renaming Columns (see Rules and Restrictions on Renaming Columns).
Change characteristics of a column.
(Constraints can also be specified when the base table is created using the CREATE TABLE statement.)
Note:   
To use this statement, the table must have a page size of 4K or larger.
ALTER TABLE is not supported for tables that contain encrypted columns.
Caution: Take care when changing a base table column that is used in another database object (such as a view or database procedure). Certain actions--such as removing or adding a base table column, or changing the size of a base table column--will require all views that use the table to be dropped and recreated.