SQL Management Studio – How to change varchar(n) to varchar(MAX)

The following SQL command can be used in SQL Management Studio to change a column from varchar(x) to varchar(MAX).

ALTER TABLE [table] ALTER COLUMN [column] VARCHAR(MAX) NULL

Note that the NULL indicates that NULL values are allowed – this is optional, however NULL is the default if it is not specified.

If the column needs to NOT allow NULL values change the NULL to NOT NULL

Was this article helpful?

Related Articles