
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[_ResumenDetalleTempario]') AND type in (N'P', N'PC'))
BEGIN
execute('CREATE PROCEDURE [dbo].[_ResumenDetalleTempario]
	-- Add the parameters for the stored procedure here
	@p_id_tempario  AS int,
	@p_id_usuario AS int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	
	declare @cadena as varchar(100)

	select @cadena=''Total Temparios: '' + cast(count(1) as varchar(100))  from cat_detalleTempario WHERE id_usuario_creo = @p_id_usuario and [id_catalogo.tempario] = @p_id_tempario 

	--String que se muestra en la pantalla detalleTempario, !SIEMPRE DEJAR ESTE SELECT @cadena DE ÚLTIMASˇ
	select @cadena
END')

END
