IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[reg_dis_obra_catalogo_m]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[reg_dis_obra_catalogo_m]
GO
CREATE PROCEDURE [dbo].[reg_dis_obra_catalogo_m]
	@p_id INT,
	@p_eid as varchar(50) = ''
AS
BEGIN
	SELECT 	[id] AS [id],
		[uid] AS [uid],
		[eid] AS [eid],
		[id_usuario_modifico] AS [id_usuario_modifico],
		[id_usuario_creo] AS [id_usuario_creo],
		[fechaModificacion] AS [fechaModificacion],
		[fechaCreacion] AS [fechaCreacion],
		[active] AS [active],
		[obra_catalogo] AS [obra_catalogo],
		[cantidad] AS [cantidad],
		[valorUnitario] AS [valorUnitario],
		[total] AS [total],
		[promedioDia] AS [promedioDia],
		[id_obra] AS [id_obra],
		[id_catalogo] AS [id_catalogo],
		[valorMaximo]AS [valorMaximo],
		[valorMinimo]AS [valorMinimo]
	FROM [dis_obra_catalogo]
	WHERE	(id = @p_id)
	AND	(eid LIKE @p_eid+'%')

END

