ALTER TABLE
table
{ [ ALTER COLUMN
column_name
{
new_data_type [
(
precision [
, scale ]
) ]
[ COLLATE < collation_name > ]
[ NULL | NOT NULL ]
| {ADD | DROP } ROWGUIDCOL }
]
| ADD
{ [ < column_definition > ]
|
column_name AS
computed_column_expression
} [
,...
n ]
| [ WITH CHECK | WITH NOCHECK ] ADD
{ < table_constraint > } [
,...
n
]
| DROP
{ [ CONSTRAINT ]
constraint_name
| COLUMN
column } [
,...
n ]
| { [ WITH CHECK | WITH NOCHECK ] CHECK | NOCHECK
} CONSTRAINT
{ ALL |
constraint_name [
,...
n ] }
| { ENABLE | DISABLE } TRIGGER
{ ALL |
trigger_name [
,...
n ] }
}
< column_definition > ::=
{
column_name
data_type }
[ [ DEFAULT
constant_expression
] [ WITH VALUES ]
| [ IDENTITY [ (
seed ,
increment ) [ NOT FOR REPLICATION ] ] ]
]
[ ROWGUIDCOL ]
[ COLLATE < collation_name > ]
[ < column_constraint > ] [ ...
n
]
< column_constraint > ::=
[ CONSTRAINT
constraint_name ]
{ [ NULL | NOT NULL ]
| [ { PRIMARY KEY | UNIQUE }
[CLUSTERED | NONCLUSTERED]
[ WITH FILLFACTOR
=
fillfactor ]
[ON {filegroup | DEFAULT} ]
]
| [ [ FOREIGN KEY ]
REFERENCES
ref_table [
( ref_column ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[NOT FOR REPLICATION]
]
| CHECK [NOT FOR REPLICATION]
( logical_expression )
}
< table_constraint > ::=
[ CONSTRAINT
constraint_name ]
{ [ { PRIMARY KEY | UNIQUE }
[CLUSTERED | NONCLUSTERED]
{
(
column [
,...
n ]
) }
[ WITH FILLFACTOR
=
fillfactor ]
[ ON {filegroup | DEFAULT } ]
]
| FOREIGN KEY
[
( column [
,...
n
]
) ]
REFERENCES
ref_table [
( ref_column [
,...
n
]
) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[NOT FOR REPLICATION]
| DEFAULT
constant_expression
[ FOR
column ] [ WITH
VALUES ]
| CHECK [NOT FOR REPLICATION]
( search_conditions )
}