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, and click Next.
    • (Optional) If creating a SQL Anywhere or Sybase IQ table, define the storage and primary key options, and click Next.
  6. Indicate whether you want to create the table immediately or save the table definition to a SQL file.

    You can select one option or both options.

    • Select Generate Script to generate the SQL code and open the file in an editor window.
    • Select Execute Immediately to create a new table and display it immediately under the Tables folder in Enterprise Explorer. If you select Execute Immediately and Open in Editor After Creation, the Table Schema Editor opens, where you can view and modify table information.
  7. Click Finish to generate and/or execute the script.
  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
Opening a Database View
Dropping a Database View
Executing View DDL
Related reference
DDL Types

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.