Step 1: Run the script in Part 1 and identify the column data type and size of the column and the column property (NULL / NOT NULL) and number of columns to be changed.
Step 2: Select the target database and run Part 2, which will generate the script required.
Step 3: Copy the script and execute on the target database and change the column size.
This script can be used for char,nchar,varchar,nvarchar to any size including MAX column length (Refer to Part 3)
One of the use case I can think of this script is changing company name. Due to recent acquisitions, we have to keep changing the company name. Ex:- Company column in the HR / Finance / Revenue / DW databases is declared as varchar(10) / char(8) as you know your company name, now that you have to update your company to the new company which has more charcters then 10 then this script will be handy :).
For me it used to update my jdbc URL column length as we want to add the failover string to the actual jdbc url through out our configuration tables.
email me incase you need more information: cusvenus@gmail.com