Subject Altering column widths when don't know column names?
Author stegt
An odd request maybe, but we have a requirement where we need to alter a table which has an unknown quantity of char(100) columns to be char(255) columns.

All the columns are prefixes 'F' then a number. The customer can add additional columns to the table at will, so we need to be able to go through a table and update all the char(100) columns to char(255).

I don't suppose there is some SQL black magic that can be used to do this?

The only way I can think of is to somehow extract the metadata from the table, then somehow find all the char(100) columns and run SQL for each column to update it, but that would mean writing an application that the customer would need to run to do the work, rather than just supplying a SQL script to do the work.

Any ideas?

Cheers.