IF EXISTS( SELECT NAME
             FROM SYSOBJECTS
            WHERE NAME = 'CTB_CCAJUSREC'
              AND TYPE = 'P')
   DROP PROCEDURE CTB_CCAJUSREC
GO
CREATE PROCEDURE CTB_CCAJUSREC(
@P_CDAJUCTREC VARCHAR(4),
@P_CDCONTCTBL VARCHAR(20) OUTPUT )

AS
   DECLARE @V_CDCONTCTBL VARCHAR(20);
BEGIN
   SELECT @V_CDCONTCTBL = CDCONTCTBL
     FROM TIPOAJRECEBER
    WHERE CDAJUCTREC = @P_CDAJUCTREC;

   SET @P_CDCONTCTBL = @V_CDCONTCTBL;

END;
GO
-- VERSAO --
EXEC ATUVEROBJ 'CTB_CCAJUSREC','5.50.xxx';
GO