Question : change data type across the database

is there a way to update all the numeric (5,2) to numeric (6,2) columns across the tables? without manually doing each one at a time?

thanks

Answer : change data type across the database

Something like this ought to generate the commands to run:

SELECT 'ALTER TABLE [' + table_schema + '].[' + table_name + ']  ' +
    'ALTER COLUMN [' + column_name + '] decimal(6, 2)'
FROM information_schema.columns
WHERE data_type = 'decimal'
AND numeric_precision = 5
AND numeric_scale = 2
Random Solutions  
 
programming4us programming4us