Modifies the design of a table after it has been created with the CREATE TABLE statement.
Note The Microsoft Jet database engine doesn’t 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.
Syntax
ALTER TABLE table {ADD {COLUMN field type [(size)] [NOT NULL] [CONSTRAINT index] |
CONSTRAINT multifieldindex} |
DROP {COLUMN field I CONSTRAINT indexname} }
The ALTER TABLE statement has these parts:
Part | Description |
table | Name of the table to be altered. |
field | Name of the field to be added to or deleted from table. |
type | Data type of field. |
size | Field size in characters (Text and Binary fields only). |
index | Index for field. See the CONSTRAINT clause topic for more information on how to construct this index. |
multifieldindex | Definition of a multiple-field index to be added to table. See the CONSTRAINT clause topic for more information on how to construct this clause. |
indexname | Name of the multiple-field index to be removed. |
Remarks
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 the CONSTRAINT clause topic.
If you specify NOT NULL for a field, then new records are required to have valid data in that field.
Notes