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

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -