DROP PROC OP_aumentarnroboleta
GO

CREATE PROC OP_aumentarnroboleta
@SALESPOINT ud_ptovta
as

BEGIN TRAN

update OP_SALESPOINTSETTING 
		set 	NBRTICKBOL  =NBRTICKBOL  +1,
			BATNBRSALES = BATNBRSALES+1
			where SALESPOINT=@SALESPOINT

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

go

OP_aumentarnroboleta 'PTOVTA02'
select SALESPOINT,NBRTICKbol from op_salespointsetting
select * from op_salespointsetting