DROP PROCEDURE Tmp_CustWarrantyUpdProc
GO
CREATE PROCEDURE Tmp_CustWarrantyUpdProc
(
	@CORRNBR        int,
	@CUSTWARRANTYTYPEID	CHAR(2),
	@TOTGAR		UD_MONTO,
	@DESCRGAR	UD_DESCRIPCION,
	@EXPIREDATE	UD_FECHA,
	@CURYID		UD_CURYID

)
AS
BEGIN
    BEGIN TRAN
 	  UPDATE Tmp_CustWarranty
	  SET 	TOTGAR=@TOTGAR,
		DESCRGAR=@DESCRGAR,
		EXPIREDATE=@EXPIREDATE,
		CURYID=@CURYID
          WHERE CORRNBR=@CORRNBR AND CUSTWARRANTYTYPEID=@CUSTWARRANTYTYPEID

    IF (@@error!=0)
    BEGIN
        RAISERROR  20000 'Error Actualizando en TMP_CUSTWARRANTY'
        ROLLBACK TRAN
        RETURN(1)
    
    END

    COMMIT TRAN

END

SELECT * FROM CustWarranty 