Altering Tables - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Altering tables

Example 1
Example 2
Example 3
Example 4
By contrast, when you specify
only once in that column. For example, in the
, the employee's social security number, can occur just once
ss_number
throughout that column. This uniqueness extends to NULL values. Thus, a
column specified as
UNIQUE
This section describes how to change the structure of a table using the
statement.
TABLE
The following command adds a column to the
optional description of the skill:
ALTER TABLE skill
ADD skill_description CHAR( 254 )
The following statement changes the name of the
classification:
ALTER TABLE skill
RENAME skill_type TO classification
The following statement deletes the
ALTER TABLE skill
DELETE classification
The following statement changes the name of the entire table:
ALTER TABLE skill
RENAME qualification
These examples show how to change the structure of the database. The
statement can change many characteristics of a table—foreign keys can
TABLE
be added or deleted, and so on. However, you cannot use
table or column constraints. Instead, you must
the new one. In all these cases, once you make the change, stored
ADD
procedures, views, and any other item referring to this column will no longer
work.
For a complete description of the ALTER TABLE command, see Adaptive
Server IQ Reference Manual. For information about building constraints into
table definitions using ALTER TABLE, see Chapter 7, "Ensuring Data
Integrity"
CHAPTER 3
Working with Database Objects
or
UNIQUE
PRIMARY KEY
employee
must also have the constraint
table to allow space for an
skill
skill_type
column.
classification
DELETE
, each value can occur
table, each value of
.
NOT NULL
ALTER
column to
ALTER
to change
MODIFY
the old constraint and
123

Advertisement

Table of Contents
loading

Table of Contents