
    GAST CONSTRUCTION COMPANY, INC., and Rogers, Perlenfein & Associates, Plaintiffs and Appellees, v. BRIGHTON PARTNERSHIP, a North Dakota Partnership, Ronald C. Wilson and Joan E. Wilson, husband and wife, and James J. Gress and Vernetta A. Gress, husband and wife, Defendants and Appellants.
    Civ. No. 870339.
    Supreme Court of North Dakota.
    April 18, 1988.
    As Amended April 27, 1988.
    
      Sortland Law Office, Fargo, for defendants and appellants; argued by Paul A. Sortland.
    DeMars, Turman & Johnson, Ltd., Fargo, for plaintiffs and appellees Rogers, Perlen-fein & Assoc.; argued by Jonathan R. Fay.
    Johnson, Johnson, Stokes, Sandberg & Kragness, Ltd., Wahpeton, for plaintiff and appellee Gast Const. Co., Inc.; argued by Duane A. Kragness.
   LEVINE, Justice.

Brighton Partnership (Brighton) attempts to appeal from three orders: an order dismissing with prejudice its counterclaim against Gast Construction Co., Inc. (Gast); an order dismissing with prejudice its counterclaim against Rogers, Perlenfein & Associates (Rogers); and an order assessing attorney’s fees for bringing a frivolous motion for summary judgment. We dismiss the appeal.

Gast and Rogers commenced a lawsuit against Brighton to foreclose mechanic’s liens for services performed but not paid for. Brighton answered and counterclaimed. While the answer disputed the validity of the mechanic’s liens as well as the amount due, the counterclaim against Gast alleged failure to complete the construction with resulting damages and lost profits. The counterclaim against Rogers claimed damage from architectural malpractice.

During discovery Brighton refused to disclose the terms of its prior settlement of litigation that involved other parties but the same property. Gast brought a motion to compel disclosure and the trial court granted the motion but denied Brighton’s request for a protective order for confidentiality. The order stated that failure to disclose would result in dismissal of the counterclaim. On September 1, 1986, no disclosure having been made, an order was entered dismissing with prejudice the counterclaim against Gast. Thereafter, Rogers brought a similar motion with identical results. Brighton appealed after requesting without success a Rule 54(b) certification.

Prior to the appeal, Brighton had also moved for summary judgment. That motion was denied and because it was deemed frivolous, attorney’s fees were assessed against Brighton.

On appeal, Brighton argues that the trial court was wrong in dismissing its counterclaims against Gast and Rogers and in assessing attorney’s fees against it for the frivolous motion for summary judgment.

We must have jurisdiction in order to consider the merits of this appeal. E.g., Gillan v. Saffell, 395 N.W.2d 148 (N.D.1986). In an appeal where there are unad-judicated claims remaining to be resolved in the trial court, our appellate jurisdiction comes from two sources. See Gillan v. Saffell, supra. First, the order appealed from must meet one of the statutory criteria of appealability set forth in NDCC § 28-27-02. If it does not, our inquiry need go no further and the appeal must be dismissed. Gillan v. Saffell, supra. If it does, then Rule 54(b), NDRCivP, must be complied with. E.g., Production Credit Ass’n of Grafton v. Porter, 390 N.W.2d 50 (N.D.1986). If it is not, we are without jurisdiction. Ibid.

Ordinarily, orders relative to discovery procedures are interlocutory and not appealable under NDCC § 28-27-02, but interlocutory orders may be appealable if they involve the merits of the action. Phoenix Assurance Co. of Canada v. Runck, 317 N.W.2d 402 (N.D.1982), cert. denied, 459 U.S. 862, 103 S.Ct. 137, 74 L.Ed.2d 117 (1982), appeal after remand, 366 N.W.2d 788 (N.D.1985); NDCC § 28-27-02(5). Neither side has briefed or argued whether the orders of dismissal of the counterclaims are appealable under NDCC § 28-27-02. Even if they are, but see, Gauer v. Klemetson, 333 N.W.2d 436 (N.D.1983), the absence of a Rule 54(b) order by the trial court certifying that there is no just reason for delay and ordering entry of judgment of dismissal, is fatal to this appeal.

The object of Rule 54(b), NDRCivP, is to deter piecemeal disposal of litigation and avoid injustice caused by unnecessary delay in adjudicating the separate claims. Brown v. Will, 388 N.W.2d 869 (N.D.1986). There remains pending in the trial court the trial of the primary action on the mechanic’s liens. Because the trial court declined to order entry of final judgment of dismissal of the counterclaims, those orders of dismissal are interlocutory and non-appealable under Rule 54(b).

The order assessing attorney’s fees against Brighton was issued in connection with the order denying Brighton’s motion for summary judgment. An order denying a motion for summary judgment is not appealable. Gillan v. Saffell, supra. So too, an order assessing attorney’s fees against a party without adjudicating the case proper is not an appealable order. State ex rel. Olson v. Nelson, 222 N.W.2d 383 (N.D.1974). While we have jurisdiction to review nonappealable orders when there is an appeal from a final judgment, e.g., Fiebiger v. Fischer, 276 N.W.2d 241 (N.D.1979), we have no jurisdiction to review a nonappealable order that is ancillary to another nonappealable order. Cf. Herzog v. Yuill, 399 N.W.2d 287 (N.D.1987).

Accordingly, the appeal is dismissed with costs on appeal awarded to appellees and the case is remanded for trial of the mechanic’s lien claims.

ERICKSTAD, C.J., and VANDE WALLE, GIERKE and MESCHKE, JJ., concur.  