

declare @id_reporte as integer
set @id_reporte =(select id from rep_reporte where reporte_codigo ='formatos/Traslado')
declare @uid varchar(500)
select @uid=uid from seg_usuario where id=1

if not exists (select * from rep_campoReporte  where id_reporte = @id_reporte  )
begin
insert into [rep_campoReporte]  ([uid],[eid] ,[id_usuario_modifico] ,[id_usuario_creo] ,[fechaCreacion],[fechaModificacion],
[active] ,[campoReporte] ,[campoReporte_codigo] ,[id_reporte] ,[id_tipoCampoReporte] ,[tabla] ,[valorDefecto], [esParametro], [esSerie],[parametroTotal] ) 
values 
(@uid,'01',0,0,GETDATE(),GETDATE(),1,'ID Traslado','',@id_reporte ,2,'doc_documento','',0,0,1)

end



