Alter 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. See View dependencies.

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

To alter an existing table (Sybase Central)
  1. Connect to the database as a user with DBA authority, 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. In the left pane, double-click Views.

    2. Right-click the materialized view and choose Disable.

  3. Double-click Tables and select the table you want to alter.

  4. In the right pane, click the Columns tab and alter the table settings.

  5. Choose File » Save.

  6. If you disabled materialized views, re-enable and initialize each one. See Enable and disable materialized views.

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 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