DROP PROC OP_SALVARTRANSACCION
GO

CREATE PROC OP_SALVARTRANSACCION
@CORRNBR		INTEGER,
@TOTALPEN		UD_MONTO
AS
BEGIN

BEGIN TRAN

UPDATE TMP_OP_SALESCSTORE set
		TOTALPEN = @TOTALPEN ,
		STKSAVE=1
		where CORRNBR = @CORRNBR

 IF (@@error!=0)
    BEGIN
        RAISERROR  20000 'OP_SALVARTRANSACCION: Error al Salvar Transaccion'
        ROLLBACK TRAN
        RETURN(1)    
    END
    COMMIT TRAN   

END
GO

SELECT * FROM TMP_OP_SALESCSTORE 
