07-31-2023, 09:40 AM
If you don't want to write the whole thing yourself and change all the columns to the same datatype this can make it easier:
select 'alter table tblcommodityOHLC alter column '+name+ 'NUMERIC(18,0);'
from syscolumns where id = object_id('tblcommodityOHLC ')
You can copy and paste the output as your query
select 'alter table tblcommodityOHLC alter column '+name+ 'NUMERIC(18,0);'
from syscolumns where id = object_id('tblcommodityOHLC ')
You can copy and paste the output as your query