Search code examples
sqltypesvarchar

Varchar(255) to Varchar(MAX)


Is it possible to change a column type in a SQL Server 2008 database from varchar(255) to varchar(MAX) without having to drop the table and recreate?

SQL Server Management Studio throws me an error every time I try to do it using that - but to save myself a headache would be nice to know if I can change the type without having to DROP and CREATE.

Thanks


Solution

  • You should be able to do it using TSQL.

    Something like

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