2

If I want to extend a column length from 30 to 60 characters for a varchar column in SQL Server Management Studio, I have to uncheck the box Prevent saving changes that require table re-creation.

Are there any side effects to doing this table re-creation? Will I reset the identity or increment seed, loose indices or find any other unwanted effects?

I need to do this on a live DB and I don't want to find out the hard way that something has changed.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Niklas
  • 13,005
  • 23
  • 79
  • 119

2 Answers2

1

This is a metadata only change that does not require rebuilding the table.

ALTER TABLE YourTable ALTER COLUMN YourColumn VARCHAR(60) [NOT] NULL

Regarding your question "are there any side effects to doing this table re-creation" through the GUI.

It is completely unnecessary overhead in this case and would block concurrent users until the table is copied and recreated. Additionally the designer has known bugs when doing this (e.g. drops FILESTREAM attribute from columns)

Martin Smith
  • 438,706
  • 87
  • 741
  • 845
0

There are similar questions like this asked before. Look at the answers to: "Prevent saving changes that require the table to be re-created" negative effects and Can't change table design in SQL Server 2008

Good luck. //Flipbed

Community
  • 1
  • 1
Flipbed
  • 719
  • 9
  • 18