You can add a new column easily if the table is empty. However, if the table already holds data, you can only add a column if the column definition includes a default value or allows NULL values.
You can use either Sybase Central or directly execute a SQL statement (for exmaple, 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, right-click the background and select New > Column.
Set all new attributes for the column. You must declare a name, a data type, constraints, whether or not the table allows null values, and so on.
Choose File > Save Table when finished.
In Interactive SQL, you can only declare columns while creating or altering a table.
Connect to the UltraLite database.
Execute a CREATE TABLE statement or ALTER TABLE, ensuring that you define columns by declaring the name, and other attributes accordingly.
Examples The following example creates a table for a library database to hold information on borrowed books. The default value for date_borrowed indicates that the book is borrowed on the day the entry is made. The date_returned column is NULL until the book is returned.
CREATE TABLE borrowed_book ( loaner_name CHAR(100) PRIMARY KEY, date_borrowed DATE NOT NULL DEFAULT CURRENT DATE, date_returned DATE, book CHAR(20) )
The following example modifies the customer table to now include a column for addresses that can hold up to 50 characters:
ALTER TABLE customer ADD address CHAR(50)