Modifies the design of a table after it has been created with the CREATE TABLE statement.
Note The Microsoft Jet database engine does not support the use of ALTER TABLE, or any of the data definition language (DDL) statements, with non-Microsoft Jet databases. Use the DAO Create methods instead.
ALTER TABLE table {ADD {COLUMN field type[(size)] [NOT NULL] [CONSTRAINT index] |
ALTER COLUMN field type[(size)] |
CONSTRAINT multifieldindex} |
DROP {COLUMN field I CONSTRAINT indexname} }
The ALTER TABLE statement has these parts:
Part | Description |
---|---|
table | The name of the table to be altered. |
field | The name of the field to be added to or deleted from table. Or, the name of the field to be altered in table. |
type | The data type of field. |
size | The field size in characters (Text and Binary fields only). |
index | The index for field. For more information on how to construct this index see CONSTRAINT Clause. |
multifieldindex | The definition of a multiple-field index to be added to table. For more information on how to construct this index see CONSTRAINT Clause. |
indexname | The name of the multiple-field index to be removed. |
Using the ALTER TABLE statement you can alter an existing table in several ways. You can:
ALTER TABLE Employees ADD COLUMN Notes TEXT(25)
You can also define an index on that field. For more information on single-field indexes see CONSTRAINT Clause.
If you specify NOT NULL for a field then new records are required to have valid data in that field.
ALTER TABLE Employees ALTER COLUMN ZipCode TEXT(10)
Notes