Creating a Column

Create a new column for a table in the Table Schema Editor.

Prerequisites 

Before you can create a column, be sure that the database server that the contains the table for which you want to add a new column is running, and that you connected to the database through a connection profile.

  1. In Enterprise Exploere, expand the Tables folder, right-click on Columns and select New > Column .
  2. Enter column information.
    Option Description
    Filter Use regular expressions to display a subset of columns, then click Filter. For example, to display all columns that begin with a "c," enter c. To display all columns that begin with "au" and end in an "e," enter au*e.
    Primary Key Click to define this column as the primary key.
    Column Name Enter a name for the column.
    Datatype Select or enter the datatype associated with the column.
    Nullable Click to indicate that the column can be NULL.
    Default View the column default value. This is a read-only column. When you double-click the cell, a Browse button appears. You can click it to define a default.
    Rule Binding (ASE only) Specify a rule to bind the column to by selecting a rule from the drop-down menu.
    Identity (ASE only) Select to make this column an IDENTITY column. ASE automatically generates a value for this row that uniquely identifies the row within the table.
    Check Constraint (ASE only) Click ... to open the Define column check constraint wizard.
    IQ Unique (Sybase IQ only) Define the cardinality of the column. This column is used to optimize the indexes internally. Specify the IQ Unique constraint if the expected number of unique values is less than or equal to 65536. The default is 0.
    Comment (SQL Anywhere, Sybase IQ only) Enter addtional comments about the column.
  3. (Optional) Continue to add additional columns.
  4. When finished defining columns, select File > Save from the WorkSpace main menu.
  5. Click Save in the Preview Changes window to execute the SQL code and save the changes to the database.

    The Preview Changes window appears unless the option is unselected through the Schema Object Editor Configuration preference page.

Related tasks
Editing Table Schema Data
Entering Column Default Values
Copying a Column
Cutting a Column
Pasting a Column
Dropping a Column


Created June 25, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com