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.
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.
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; |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |