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

)
AS
BEGIN
    BEGIN TRAN

          INSERT INTO Tmp_CustWarranty(CORRNBR,CUSTWARRANTYTYPEID,TOTGAR,DESCRGAR,EXPIREDATE,CURYID)
          VALUES(@CORRNBR,@CUSTWARRANTYTYPEID,@TOTGAR,@DESCRGAR,@EXPIREDATE,@CURYID)

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

    COMMIT TRAN

END


