Creating a Table

Create and define properties for SQL Anywhere, ASE, and Sybase IQ database tables and ASE temporary tables.

Prerequisites 

Make sure you are connected to a data server and that the user login associated with the connection profile has permission to create tables.

For ASE databases, use the New Table wizard to:
  • Create tables
  • Create temporary tables
  • Define columns
  • Define physical storage
  • Define cache strategy
  • Define row locking strategy
For SQL Anywhere and Sybase IQ databases, use the New Table wizard to:
  • Create tables
  • Create global temporary tables
  • Configure columns
  • Configure primary key
  • Configure storage options
  1. Right-click the Tables folder and select New > Table.
  2. (Optional) Select a different schema object Owner.
  3. Enter a Table Name to identify the table.
  4. Enter the column information.
    Field Description
    Primary Key Select the check box to define the primary key.
    Column Name Enter a name for the column.
    Datatype Enter the datatype associated with the column.
    Nullable 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 Browse to open the Column Default Value dialog.
    Rule Binding (ASE only) Specify a rule to bind the column to by selecting a rule from the drop-down menu.
    Identity (ASE only) Make this column an IDENTITY column. ASE automatically generates a value for this row that uniquely identifies the row within the table.
    Unique Indicate that the value in the column must be unique.
    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 additional comments about the column.
  5. Click Next.
    • (Optional) If creating an ASE table, define the physical storage, cache strategy, and locking strategy.
    • (Optional) If creating a SQL Anywhere or Sybase IQ table, define the storage and primary key options.
  6. Click Next and specify save and execution properties.
    Field Description
    Generate Script Generate a SQL file for the table.
    Enter or Select the Parent Folder Specify an existing project or create a new project in which to save the SQL file.
    File Name Enter the file name in which to store the SQL code.
    Execute Immediately Execute the SQL code immediately. If you do not select this option, you must complete execution of the SQL file later to create the table.
    Open in Editor After Creation Create the table and open it in the Table Schema Editor.
  7. Click Finish.
  8. Review the status in SQL Results view.
Related concepts
View Editor
Related tasks
Creating a Database
Editing Table Schema Data
Entering Column Default Values
Opening a Referenced Database Object
Viewing the Database Definition Language for a Table
Editing and Viewing Table Storage Properties
Dropping a Table
Renaming a Table
Truncating Table Data
Creating an ASE Nonsharable Temporary Table
Creating a SQL Anywhere or a Sybase IQ Temporary Table
Granting and Revoking Table Permissions
Creating a Database View
Editing a Database View
Dropping a Database View
Executing View DDL

For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com