Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Working with Database Objects » Working with tables » Altering tables

Altering tables Next Page

Altering tables (Sybase Central)


You can alter tables in Sybase Central on the Columns tab in the right pane. For example, you can add or drop columns, change column definitions, or change table or column properties. Altering tables fails if there are any dependent materialized views; you must first disable dependent materialized views. Once your table alterations are complete, you must re-enable the dependent materialized views.

Use the sa_dependent_views system procedure to determine if there are dependent materialized views. See sa_dependent_views system procedure.

For more information about view dependencies, see View dependencies.

To alter an existing table (Sybase Central)
  1. Connect to the database as the DBA or as owner of the table.

  2. If you are making a schema change and there are materialized views dependent on the table, disable each one as follows:

    1. Open the Views folder and select the materialized view.

    2. Choose File > Disable.

  3. Open the Tables folder and select the table you want to alter.

  4. Click the Columns tab in the right pane and make the necessary changes.

  5. Choose File > Save.

    The database server saves the changes to the table.

  6. If you disabled materialized views, re-enable and initialize each one as follows:

    1. Open the Views folder and select the materialized view.

    2. Choose File > Recompile and Enable.

    3. Choose File > Refresh Data.

Tips

You can add columns by selecting a table's Columns tab and choosing File > New Column.

You can drop columns by selecting the column on the Columns tab and choosing Edit > Delete.

You can copy a column to a table by selecting the column on the Columns tab in the right pane and then clicking Copy. Select the desired table, click the Columns tab in the right pane, and then click Paste.

It is also necessary to click Save or choose File > Save. Changes are not made to the table until then.

See also