Alter Table
You can Alter the definition of a table by (in the Database Explorer window) clicking on a table then the Alter button in the Admin Toolbar.
You will be shown a window such as the following:
You will not be able to amend every part of a table's definition. Different databases have different rules about which parts of the table definition can be altered.
- attributes that you are able to change will be in white. Non-changeable values are in grey.
- once you have amended a value, it will be shown in yellow. This indicates a pending change.
- if your database allows you to delete columns, you will have a button Delete Column - click on this to mark the column for deletion. A pending deletion is shown in yellow with strike-through font. If you subsequently click the column, the Undelete Column button will be displayed. Clicking on this will take the column out of delete-pending status.
- clicking on Preview shows you the SQL that AQT will run for applying the changes that you have made.
Applying the Changes
Click on Run to run the changes.
- AQT will apply the changes to the database by running a series of SQL statements.
- AQT keeps track of whether each change is successful. If so, the value you have changed is taken out of change-pending status (and returns to being white). Any columns or objects you have deleted are removed from the grids.
- If the change is not successful, the change remains in change-pending or delete-pending status; you can then correct your changes and click on Run again.
- Can click on Refresh to re-load the table definition. This can be useful after you have made as series of changes.