EXHIBIT 10-5

                   SEVERANCE AGREEMENT WITH YITZHAK N. BACHANA

                                    FORM 10K

                   FOR THE FISCAL YEAR ENDED OCTOBER 31, 1998

               MEGADATA CORPORATION COMMISSION FILE NUMBER 0-7642



                     SEVERANCE AGREEMENT AND GENERAL RELEASE


           This SEVERANCE AGREEMENT AND GENERAL RELEASE ("Agreement") is entered
into effective as of October 30, 1998 between MEGADATA CORPORATION (the
"Company") and YITZHAK N. BACHANA (THE "Employee").

                                    RECITALS

           A. The Employee and the Company desire to terminate the employment of
the Employee by the Company and all other agreements that may exist between the
Employee and the Company.

           B. The Company and the Employee wish to ensure for the future that
there are no outstanding disputes between them pertaining to any matter arising
prior to the date hereof.

           Now THEREFORE, for good and valuable consideration, the receipt and
sufficiency of which is hereby acknowledged, the parties hereto agree as
follows:

                                    AGREEMENT

           1. RESIGNATION. The Employee hereby resigns his employment with the
Company and all positions and titles he may have with the Company and its
subsidiaries, including without limitations his position as President and Chief
Executive Officer of the Company, effective as of October 2, 1998 (the
"Termination Date"). Notwithstanding the foregoing, the Employee will continue
to serve as a member of the board of directors of the Company through the
remainder of his current term.

           2. TERMINATION OF EXISTING AGREEMENTS. Except as expressly provided
herein, all rights and obligations of the Company or the Employee under any
employment agreement or other arrangement and any other agreements between the
Company and the Employee are hereby canceled and terminated effective as of the
Termination Date without liability of any party hereunder.


                                                                               1


<PAGE>


           3. SEVERANCE. In consideration for Employee's past service to the
Company, the Employee will receive $8,333.00 per month (the "Severance") from
the Termination Date through and including March 31, 1999 for a maximum period
of six months. The Severance will be payable on the last day of each month for
the immediately succeeding month. Notwithstanding the foregoing, the Severance
will not be payable until November 30, 1998 and the amounts accruing for the
months of October 1998 and November 1998 will not be payable until March 31,
1999. Company agrees to report to the Internal Revenue Service those payments
actually paid and received by Employee during any taxable year. These Severance
payments may be terminated prior to March 31, 1999 by written notice upon breach
by the Employee of his obligations under Section 4 below.

           4. SERVICE AS CONSULTANT. From the Termination Date through and
including March 31, 1999 (such period, as it may be earlier terminated by the
Company by written notice upon breach of the Employee of his obligations under
this Section 4, the "Consulting Period"), the Employee will offer his services,
at no charge, as a consultant to the Company. During the Consulting Period, the
Employee agrees to serve in an advisory function at the direction and control of
the officers and directors of the Company. During the Consulting Period, the
Employee agrees to: (a) cooperate diligently with the officers, employees and
directors of the Company; and (b) devote reasonable time and effort, but not
full-time, to fulfill his duties hereunder.

           5.        BENEFITS.

           a) The Company will transfer to Employee any rights it may have with
      respect to the life insurance policy currently maintained by the Company
      with respect to the life of the Employee in accordance with the terms
      thereof. As of the Termination Date, the Company will have no further
      responsibility for payments of any premiums or other fees, costs or
      expenses of any nature with respect thereto.

           b)        The Employee acknowledges that, as of the Termination Date,
      he will no longer be entitled to any benefits under any of the Company's 
      benefit plans or programs, including without limitations the Company's 
      health benefit plan. The Employee further represents that he is entitled
      to coverage under the health benefit plans maintained by Data Probe, Inc.
      in accordance with the terms thereof.

           6. AUTOMOBILE. The Employee will purchase the automobile currently
provided for his use by the Company for $2,000. The purchase price for such
automobile will be deducted by the Company from the balance due Employee on
March 31, 1999.

           7. BACK SALARY. The Employee acknowledges receipt from the Company,
on September 10 and October 2, the aggregate sum of $6,000 in previously accrued
and unpaid salary owed to the Employee by the Company. The Company agrees to pay
to the Employee the balance of all accrued and unpaid salary, in the net sum of
$18,230, currently owed the employee by the Company as of the Termination Date.
Such payment will be made on March 31, 1999.


                                                                               2


<PAGE>


           8. CORPORATE GOVERNANCE MATTERS. The Employee, in his capacity as a
shareholder and director of the company agrees to support: (a) the election of
G.S. Beckwith Gilbert as President and Chief Executive Officer of the Company;
(b) the approval of fair compensation for Mr. Gilbert in such capacity payable
by the Company; and (c) the approval of the payment of compensation and expenses
by the Company of Mr. James T. Barry at levels approved by Mr. Gilbert.

           9.        GENERAL RELEASES.

           a) The Employee irrevocably and unconditionally releases, remits,
      acquits, and discharges the Company and its present and former officers,
      directors, partners, shareholders, legal representatives, agents,
      employees, contractors, successors and assigns (collectively, "Company
      Parties"), jointly and individually, from any and all claims, known or
      unknown, which the Employee, his heirs, executors, administrators, legal
      and personal representatives, successors or assigns (collectively,
      "Employee Parties") have or may have against the Company Parties and any
      and all liability which the Company Parties may have to him or other
      Employee Parties whether called claims, demands, causes of action,
      obligations, damages or liabilities arising from any basis and all bases,
      however called, from the beginning of time through and including the date
      hereof, except for claims or liabilities arising under this Agreement and
      all rights to indemnification pursuant to statute, certificate of
      incorporation, by-laws, insurance, or otherwise. The Company agrees that,
      for so long as it provides directors or officers liability insurance for
      any of its directors or officers, it will include Employee as part of such
      coverage on terms no less favorable than that provided to any of its then
      directors and officers.

           b) The Company irrevocably and unconditionally releases, remits,
      acquits, and discharges the Employee Parties, jointly and individually,
      from any and all claims, known or unknown, which the Company or any other
      Company Party have or may have against Employee Parties and any and all
      liabilities which the Employee Parties may have to the Company or the
      other Company Parties whether called claims, demands, causes of action,
      obligations, damages or liabilities arising from any basis and all bases,
      however called, from the beginning of time through and including the date
      hereof.

           10. OTHER AGREEMENTS. This Agreement supersedes all prior agreements
among the parties hereto (all copies of which (in the possession of any Employee
Party) have been delivered by the Employee to the Company), and the Employee
agrees by execution of this Agreement, he will have resigned from all positions
with the Company (other than his position as a member of the board of directors)
and that he makes no claim to any compensation, benefits or any other right or
alleged right from the Company except as may be provided herein. Notwithstanding
the forgoing, the Company agrees that any benefits given to its outside
directors, in their capacity as directors, will also be given to Employee while
acting as a director of the Company.


                                                                               3


<PAGE>


           11. COUNSEL. Each party agrees that such party was able to consult
with counsel about this Agreement and its provisions and that this Agreement is
executed with such party's own free will and without duress.

           12. AMENDMENTS. This Agreement may only be modified by a written
amendment executed by both parties hereto.

           13. COUNTERPARTS. This Agreement may be executed in one or more
counterparts each of which will be deemed an original, but all of which will be
deemed one instrument. Signatures delivered by facsimile will be deemed to be
original signatures.

           14. GOVERNING LAW. The provisions of this Agreement will be governed
by the internal laws of the State of New York without regard to conflict of
laws. Each party hereto agrees that the courts of the State of New York shall
have the authority to interpret and enforce this Agreement and each party agrees
to submit to the jurisdiction of such courts if any such dispute should arise.


           IN WITNESS WHEREOF, the parties hereto have executed this Agreement
as of the date first above written.

                              MEGADATA CORPORATION


                              By: ______________________
                                      Name:
                                     Title:


                              -------------------------
                              YITZHAK N. BACHANA

                              Address for notices:

                              361 Woodmere Boulevard
                              Woodmere, New York  11598

                              Tel. No.:  (516) 569-1109