ALTER TABLE column_definition
changes a column, constraint or column property
What changes
- Input
- table definition
- Output or change
- column or constraint definition
Syntax at a glance
column_name <data_type> [ FILESTREAM ] [ COLLATE collation_name ] [ NULL | NOT NULL ] [ [ CONSTRAINT constraint_name ] DEFAULT constant_expression [ WITH VALUES ] | IDENTITY [ ( seed , increment ) ] [ NOT FOR REPLICATION ] ] [ ROWGUIDCOL ] [ SPARSE ] [ ENCRYPTED WITH ( COLUMN_ENCRYPTION_KEY = key_name , ENCRYPTION_TYPE = { DETERMINISTIC | RANDOMIZED } , ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256' ) ] [ MASKED ...
Work example
A column definition needs a syntax review before the table change is approved.
Compare name, type, nullability, collation, identity, and default clauses with the data contract.
Check your work The declared column shape matches the application parameter and output types.
Open Microsoft Learn for full syntax, permissions, and details for your version.