You can change the structure of column definitions for a table by altering various column attributes, or even deleting columns entirely. The modified column definition must suit the requirements of any data already stored in the column. For example, you cannot alter a column to disallow NULL if the column already has a NULL entry.
You can use either Sybase Central or Interactive SQL to perform this task.
In Sybase Central, you can perform these tasks while working with a selected table.
Connect to the UltraLite database.
Open the Tables folder.
In the Columns tab, make the necessary attribute changes.
Choose File > Save Table when finished.
In Interactive SQL, you can perform these tasks with the ALTER TABLE statement.
Connect to the UltraLite database.
Execute an ALTER TABLE statement.
Make changes carefullyThe following examples show how to change the structure of the database. In all these cases, the statement is immediately committed. So, once you make the change, any item referring to this table may no longer work. |
Examples The following statement shortens the SkillDescription column from a maximum of 254 characters to a maximum of 80:
ALTER TABLE Skills MODIFY SkillDescription CHAR( 80 )
The following statement deletes the Classification column:
ALTER TABLE Skills DROP Classification
The following statement changes the name of the entire table:
ALTER TABLE Skills RENAME Qualification