Using alter table on remote tables  Adding columns appends column IDs

Chapter 8: Creating Databases and Tables

Adding columns

To add a column to an existing table, use:

alter table table_name 
     add column_name datatype 
     [default {constant_expression} | user | null}]
     {[{identity | null | not null}] | [constraint constraint_name
     {constraint_clause}]
     [, column_name]

Where:

For example, the following adds a non-null column named author_type, which includes the constant “primary_author” as the default value, and a null column named au_publisher to the authors table:

alter table authors
add author_type varchar(20)
default "primary_author" not null,
au_publisher varchar(40) null




Copyright © 2005. Sybase Inc. All rights reserved. Adding columns appends column IDs

View this book as PDF