Options

Changing a column length

We have several tables, that contain a lot of data, where we want to change the column length from a user defined datatype of varchar(15) to the standard datatype of varchar (30). It would be much better if we could issue an ALTER TABLE/ALTER COLUMN. 

SQL Compare seems to create a new table with the modified column, copy all the data to the new table, drop the old table and then rename the new table to the old table name. 

Is there a setting or an option that would use an ALTER Table vs creating and dropping tables?
Tagged:

Best Answer

  • Options
    PlantBasedSQLPlantBasedSQL Posts: 187 Gold 4
    Hi @mikemalino thank you for your post!

    I have set up a similar test scenario using a local DB where I changed an NVARCHAR(100) to NVARCHAR(150) and used SQL Compare to carry out the comparison and deployment which generated an ALTER statement by default.

    Can I confirm which version of SQL Compare you're using and also that the "USE DROP and CREATE instead of ALTER" project setting is unticked?

    Thank you very much!
Sign In or Register to comment.