The ALTER [COLUMN]
Clause
With the ALTER [COLUMN]
clause, attributes of existing columns can be modified without the need to drop and re-add the column.Permitted modifications are:
-
change the name (does not affect the metadata change counter)
-
change the data type (increases the metadata change counter by one)
-
change the column position in the column list of the table (does not affect the metadata change counter)
-
delete the default column value (does not affect the metadata change counter)
-
set a default column value or change the existing default (does not affect the metadata change counter)
-
change the type and expression for a computed column (does not affect the metadata change counter)
-
set the
NOT NULL
constraint (does not affect the metadata change counter) -
drop the
NOT NULL
constraint (does not affect the metadata change counter) -
change the type of an identity column, or change an identity column to a regular column
-
restart an identity column
-
change the increment of an identity column