Is it safe to increase the size of a field in a SQL table on MS SQL server?
The field is a text field, it has millions of records, but recently the entries have been too big to fit so we need to increase the size of the field.
Assuming there is enough space on the server, and that any associated DTS or code that is run on the data can also be changed - could there be any problems associated with this?
Yeah, I’ve had to do this often. Never seems to be an issue. I don’t think it even requires recreating the table behind the scenes, just issuing an ALTER TABLE statement against it.
It depends on how much bigger. If the physical space is fully populated there will be no room to put the new data where it should go in the disk. You will end up with chaining(The location ends up holding a pointer to the real physical location) and you can get performance hits as another disk read somewhere else is required.
Best to rebuild the table after you Alter it.
Is there any way to get SQL server to tell you how much chaining there is in a table? I don’t really want to rebuild all my tables if they don’t all need it.