I'm wondering if there is a way to loop through all of the columns in a table and increase the size of each field based on what the current size. Basically, I need any fields that currently have a field size under 1000 characters to be set to 1000 characters. I can do something like
ALTER TABLE tableName ALTER COLUMN nvarchar(1000)
for each field that I want changed, but there are hundreds of fields and I'd like to do it programmatically if possible. Thanks.
Use this to generate all your ALTER TABLEs
It's easier with the system views.