How do you change the datatype of a column in SQL Server? How do you change the datatype of a column in SQL Server? sql-server sql-server

How do you change the datatype of a column in SQL Server?


ALTER TABLE TableName ALTER COLUMN ColumnName NVARCHAR(200) [NULL | NOT NULL]

EDITAs noted NULL/NOT NULL should have been specified, see Rob's answer as well.


Don't forget nullability.

ALTER TABLE <schemaName>.<tableName>ALTER COLUMN <columnName> nvarchar(200) [NULL|NOT NULL]


Use the Alter table statement.

Alter table TableName Alter Column ColumnName nvarchar(100)