DROP PROCEDURE Tmp_CustWarrantyDelProc
GO
CREATE PROCEDURE Tmp_CustWarrantyDelProc
(
	@CORRNBR        int,
	@CUSTWARRANTYTYPEID	CHAR(2)

)
AS
BEGIN
    BEGIN TRAN

	  DELETE
	  FROM Tmp_CustWarranty
          WHERE CORRNBR=@CORRNBR AND CUSTWARRANTYTYPEID=@CUSTWARRANTYTYPEID

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

    COMMIT TRAN

END
