
delete from _columnas where tabla = 'equ_detalleAlquiler'
go
insert into _columnas 
(tabla,columna,mostrarEnGrilla,ordenGrilla,requerido,tipo,defecto,tamano)
select 
TABLE_NAME
,COLUMN_NAME
,(case when COLUMN_NAME IN('id_usuario_modifico','id_usuario_creo','active','fechaModificacion','fechaCreacion','eid') then 0 else 1 end)
,row_number ( )OVER(PARTITION BY TABLE_NAME ORDER BY   (case when TABLE_NAME like '%'+ cast(  COLUMN_NAME  as varchar(100)) +'%' then 1 else 0 end ) desc) as ordengrilla
,1
,DATA_TYPE
,COLUMN_DEFAULT
,CHARACTER_MAXIMUM_LENGTH
 FROM INFORMATION_SCHEMA.COLUMNS  columnnitas
where table_name  =  'equ_detalleAlquiler'
