

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[a_sel_doc_duracionXOT]') AND type in (N'P', N'PC'))
DROP PROCEDURE [a_sel_doc_duracionXOT]

GO

CREATE PROCEDURE a_sel_doc_duracionXOT
    @p_id INT
AS BEGIN    
   DECLARE @duracion float

   SELECT @duracion = dbo.DuracionOT(@p_id)

   select @duracion as duracion
END

