Adds new columns and constraints, changes or drops constraints, and partitions or unpartitions an existing table.
Transact-SQL Syntax
alter table [database.[owner].]table_name
{add column_name datatype [default {constant_expression | user | null}] {[{identity | null}] | [[constraint constraint_name] {{unique | primary key} [clustered | nonclustered] [with {fillfactor | max_rows_per_page} = x] [on segment_name] [references [[database.]owner.]ref_table [(ref_column)] | check (search_condition)}]}... {[, next_column]}...
| add {[constraint constraint_name] {unique | primary key} [clustered | nonclustered] (column_name [{, column_name}...]) [with {fillfactor | max_rows_per_page} = x] [on segment_name] | foreign key (column_name [{, column_name}...]) references [[database.]owner.]ref_table [(ref_column [{, ref_column}...])] | check (search_condition)}
| drop constraint constraint_name
| replace column_name default {constant_expression | user | null}
| partition number_of_partitions
| unpartition}
ODBC Syntax
ALTER TABLE base_table_name
{ADD column_identifier datatype
|ADD(column_identifier datatype[,column_identifier datatype]...)
|DROP[COLUMN]column_identifier[CASCADE|RESTRICT]}