sql server - Why does SSMS drop and recreate a table when attempting to Alter a column from varchar(8000) to varchar(MAX)? -


when attempting alter column in table varchar(8000) varchar(max), ssms generates script drops constraints on table, creates new table, inserts data old table new, drops foreign keys old table, drops old table, renames new table, recreates foreign keys on new table. safer running 'alter table tablea alter column columna varchar(max)'? when want run ssms generated script vs 'alter table tablea alter column columna varchar(max)' script?

they not functionally same. varchar(8000) has maximum of 8,000 characters. varchar(max) can technically store 2^31 - 1 (2,147,483,647) characters.

https://technet.microsoft.com/en-us/library/ms176089(v=sql.110).aspx


Comments

Popular posts from this blog

many to many - Django Rest Framework ManyToMany filter multiple values -

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

Java Entity Manager - JSON reader was expecting a value but found 'db' -