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.
To alter an existing UltraLite column (Sybase Central)
Connect to the UltraLite database.
In the left pane, double-click Tables.
Double-click a table.
Click the Columns tab and alter the column attributes.
From the File menu, choose Save Table.
In Interactive SQL, you can perform these tasks with the ALTER TABLE statement.
To alter an existing UltraLite column (Interactive SQL)
Connect to the UltraLite database.
Execute an ALTER TABLE statement.
The following examples show how to change the structure of the database. In all these cases, the statement is committed immediately. So, once you make the change, any item referring to this table may no longer work.
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; |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |