
378 S.E.2d 580 (1989)
Martha W. COCHRAN
v.
Jay Noel COCHRAN.
No. 8826DC729.
Court of Appeals of North Carolina.
May 2, 1989.
*581 Wyrick, Robbins, Yates and Ponton by Robert A. Ponton, Jr., and L. Diane Tindall, Raleigh, for appellants.
James, McElroy and Diehl by William K. Diehl, Jr. and Judith E. Egan, Charlotte, for plaintiff-appellee.
EAGLES, Judge.
As a general rule, an order compelling discovery is not immediately appealable because it is interlocutory and does not affect a substantial right which would be lost if the ruling is not reviewed before final judgment. Dunlap v. Dunlap, 81 N.C.App. 675, 676, 344 S.E.2d 806, 807, disc. rev. denied, 318 N.C. 505, 349 S.E.2d 859 (1986). However, our courts have held where a party is found in contempt for noncompliance with a discovery order or has been assessed with certain other sanctions, the order is immediately appealable since it affects a substantial right under G.S. secs. 1-277 and 7A-27(d)(1). See Willis v. Duke Power Co., 291 N.C. 19, 30, 229 S.E.2d 191, 198 (1976) (when civil litigant adjudged in contempt for failure to comply *582 with discovery order, the order is immediately appealable); Adair v. Adair, 62 N.C. App. 493, 495, 303 S.E.2d 190, 192, disc. rev. denied, 309 N.C. 319, 307 S.E.2d 162 (1983) (striking defendant's answer and counterclaim for failure to appear for deposition affected a substantial right and was immediately appealable).
The order from which appellants appeal contained no enforcement sanctions. It only ordered appellant Willey to appear for deposition and to produce documents. The portion of the order requiring appellants to pay the attorney fees of plaintiff is authorized by G.S. sec. 1A-1, Rule 37(a)(4). The order granting attorney fees is interlocutory, as it does not finally determine the action nor affect a substantial right which might be lost, prejudiced or be less than adequately protected by exception to entry of the interlocutory order. See Benfield v. Benfield, 89 N.C.App. 415, 419, 366 S.E.2d 500, 502-503 (1988). But see Pennwalt Corp. v. Durand-Wayland, Inc., 708 F.2d 492 (9th Cir.1983) (orders imposing sanctions on nonparties for failure to comply with discovery are considered final for purposes of appeal). Nevertheless, we have elected in our discretion to treat the purported appeal as a petition for writ of certiorari and address the merits. N.C.Rule App. Pro. 21(a)(1); G.S. sec. 7A-32(c). See Industrotech Constructors, Inc. v. Duke University, 67 N.C.App. 741, 742-43, 314 S.E.2d 272, 274 (1984).
The appellants list three assignments of error in the record on appeal. First, appellants argue that the trial court erred in granting plaintiff's motion to compel discovery. Second, they argue that the trial court erred in awarding attorney fees to the plaintiff under Rule 37(a)(4). Finally, appellants argue that the trial court erred in ordering Ms. Willey to appear for deposition pursuant to the subpoena previously served. We hold that the trial court erred in concluding that the subpoena served on Ms. Willey was sufficient to compel her attendance for deposition. Therefore, the appellants were substantially justified in opposing the discovery sought. Accordingly, the court erred when it imposed attorney fees on appellants under Rule 37(a)(4).
Rule 45 of the North Carolina Rules of Civil Procedure contains the statutory provisions applicable to subpoenas. G.S. sec. 1A-1, Rule 45. The particular provision that relates to subpoenas for taking depositions states that
[p]roof of service of a notice to take a deposition as provided in Rules 30(a) and 31(a) constitutes a sufficient authorization for the issuance by the clerk of the superior court for the county in which the deposition is to be taken of subpoenas for the persons named or described therein.
G.S. sec. 1A-1, Rule 45(d)(1). The comment to the statute sets out the distinctions among the different sections of Rule 45 and states that
[i]n sections (a) and (c), it is contemplated that the subpoena will issue from the court where the action is to be tried wherever the witness is likely to be found, while in section (d) the idea is that the subpoena shall issue from the court of the county where the deposition is to be taken.
Accord Shuford, N.C. Civ. Prac. & Proc. (3rd Ed.), Section 45-6 ("Rule 45(d)(1) authorizes only the clerk of the superior court in which the deposition is to be taken to issue a subpoena for a deposition witness and only then upon proof of service of a notice to take the deposition under Rules 30(a) or 31(a).").
Other statutory provisions that relate to the discovery process provide for different treatment of nonparty deposition witnesses as opposed to parties. For example,
[i]f a deponent fails to be sworn or to answer a question after being directed to do so by a judge of the court in the county in which the deposition is being taken, the failure may be considered a contempt of that court.
G.S. sec. 1A-1, Rule 37(b)(1). However,
[i]f a party or an officer, director or managing agent of a party or a person designated under Rule 30(b)(6) [to testify for a corporation, partnership, association or government agency] or 31(a) [to answer by deposition upon written questions] to testify on behalf of a party fails *583 to obey an order to provide or permit discovery, ... a judge of the court in which the action is pending may make such orders in regard to the failure as are just.
G.S. sec. 1A-1, Rule 37(b)(2).
Based on these statutory provisions, we hold that in order to compel the deposition testimony of a nonparty, a subpoena must be issued from the county in which the deposition is to be taken. In this case, a proper subpoena should have been issued from the Clerk of Superior Court of Wake County. Accordingly, appellants were substantially justified in opposing the discovery sought pursuant to the subpoena issued from Mecklenburg County and the trial court's imposition of attorney fees under Rule 37(a)(4) was error.
For the reasons stated, the order compelling the nonparty deponent to appear and provide documents is vacated and the judgment entered against appellants is reversed.
Order vacated and judgment reversed.
COZORT and GREENE, JJ., concur.
