

declare @columnas as table
(tabla varchar(100),columna varchar(100),num int)
insert @columnas (tabla,columna,num)
select table_name,column_name,  ROW_NUMBER() OVER (ORDER BY table_name) 
FROM INFORMATION_SCHEMA.COLUMNS  where 
 (column_name like 'direccion%' or column_name like 'ubicacion%' )
 and not table_name like 'view_%' and not table_name like 'v_%' and  not table_name like '%_aux' and  not table_name ='gen_accesosSamm'
 
 declare @ini as int 
 declare @tab as varchar (100)
 declare @col as varchar (100)
 set @ini =(select top 1 num  from @columnas  order by  num asc )
 while  @ini <=(select MAX( num)  from @columnas) 
 begin
select  @tab=tabla,@col=columna   from @columnas  where num=@ini
 execute('alter table ['+ @tab +'] alter column ['+ @col +']  varchar(300)')
  set @ini =(select top 1 num  from @columnas  where num>@ini   order by  num asc )
 end
 