Contents Index Altering tables (SQL) Browsing the information in tables

ASA SQL User's Guide
  Working with Database Objects
    Working with tables

Deleting tables


This section describes how to delete tables from a database. You can use either Sybase Central or Interactive SQL to perform this task. In Interactive SQL deleting a table is also called dropping it.

You cannot delete a table that is being used as an article in a SQL Remote publication. If you try to do this in Sybase Central, an error appears.

To delete a table (Sybase Central)

  1. Connect to the database.

  2. Open the Tables folder for that database.

  3. Right-click the table and choose Delete from the popup menu.

To delete a table (SQL)

  1. Connect to the database with DBA authority.

  2. Execute a DROP TABLE statement.

Example 

The following DROP TABLE command deletes all the records in the skill table and then removes the definition of the skill table from the database

DROP TABLE skill

Like the CREATE statement, the DROP statement automatically executes a COMMIT statement before and after dropping the table. This makes permanent all changes to the database since the last COMMIT or ROLLBACK. The drop statement also drops all indexes on the table.

For more information, see DROP statement.


Contents Index Altering tables (SQL) Browsing the information in tables