DROP PROCEDURE TMP_IN_COMPETITIONPRICEUpdProc
GO
CREATE PROCEDURE TMP_IN_COMPETITIONPRICEUpdProc
(	@CORRNBR	INT,
	@SITEID		UD_IDSITE,
	@DATEPROCE	UD_FECHA,
	@INVTIDSKU	UD_IDCORPORATIVO,
	@PRICESUGGESTED	UD_PRECIO
)
AS
BEGIN
	BEGIN TRAN



	UPDATE	TMP_IN_COMPETITIONPRICE
	SET 	PRICESUGGESTED=@PRICESUGGESTED
	WHERE 	SITEID=@SITEID AND DATEPROCE=@DATEPROCE AND INVTIDSKU=@INVTIDSKU AND CORRNBR=@CORRNBR


	IF(@@ERROR!=0 OR @@ROWCOUNT=0)
	BEGIN
		ROLLBACK
		RAISERROR 20000 'Error Actualizando en Temporal'
		RETURN(1)
	END 


	COMMIT TRAN
	RETURN(0)
END 


