
GO

/****** Object:  StoredProcedure [dbo].[upd_rep_reporte]    Script Date: 01/09/2014 15:25:22 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[upd_rep_reporte]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[upd_rep_reporte]
GO


/****** Object:  StoredProcedure [dbo].[upd_rep_reporte]    Script Date: 01/09/2014 15:25:22 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[upd_rep_reporte]
	@p_id int = null,
		@p_uid varchar(500) = null,
		@p_eid varchar(50) = null,
		@p_id_usuario_modifico int = null,
		@p_id_usuario_creo int = null,
		@p_fechaCreacion smalldatetime = null,
		@p_reporte varchar(300) = null,
		@p_reporte_codigo varchar(100) = null,
		@p_id_funcionalidad int = null,
		@p_esFormato bit = null,
		@p_tieneGraficos bit = null,
		@p_cabecera varchar(1) = null,
		@p_orden int = null,
		@p_basica bit = null
AS
BEGIN
		UPDATE [rep_reporte]
		SET	[uid] = isnull(@p_uid,[uid]),
			[eid] = isnull(@p_eid,[eid]),
			[id_usuario_modifico] = isnull(@p_id_usuario_modifico,[id_usuario_modifico]),
			[id_usuario_creo] = isnull(@p_id_usuario_creo,[id_usuario_creo]),
			[fechaModificacion] = GETDATE(),
			[reporte] = isnull(@p_reporte,[reporte]),
			[reporte_codigo] = isnull(@p_reporte_codigo,[reporte_codigo]),
			[id_funcionalidad] = isnull(@p_id_funcionalidad,[id_funcionalidad]),
			[esFormato] = isnull(@p_esFormato,[esFormato]),
			[tieneGraficos] = isnull(@p_tieneGraficos,[tieneGraficos]),
			[cabecera] = isnull(@p_cabecera,[cabecera]),
			[orden] = isnull(@p_orden,[orden]),
			[basica] = isnull(@p_basica,[basica])
		WHERE (id = @p_id)
END
GO


