This is an appeal from an order of the circuit court refusing to vacate and set aside a judge’s order discharging the petitioner on habeas corpus. In the petition for the writ the petitioner set out a copy of the complaint, judgment and execution under which he was held by the defendant, Hubbard, as sheriff of Minnehaha county. The action, as appears from the complaint, was brought upon three promissory notes executed by the petitioner to the Esterly Harvesting Machine Company, and transferred by that company to John Sundback, who was the plaintiff in the action. The plaintiff, Sundback, for cause of action, alleged “that on or about July 20, 1885, the said defendant (Griffith), for a valuable consideration, made and delivered to the Esterly Harvesting Company, a corporation, his three promissory notes in writing, of which the following is a copy.” Then follow copies of the three notes, to each of which was annexed a representation in the following form: ‘ ‘For the purpose of obtaining the property for which this note is given, I, I. N. Griffith, certify that I am the owner,” etc., “of 160 acres of land,” etc., of the value of $3,000, and personal property of the value of $2,000. The complaint also contained the following allegation and prayer for judgment: “(2) That, to obtain the credit and property for which said notes were given, the defendant represented that he was solvent, and had real property valued at two thous- and five hundred dollars above all incumbrances, and had two thousand dollars worth of personal property over and above all indebtedness and exemptions. (3) That said machine company, relying on said statement and representations, and believing the same to be true, and not knowing the contrary, did sell property for which sa,id notes were given, to said defendant, on credit, and took his notes therefor, which, but for said representations, it would not so have done. (4) That said representations were false. (5) That this plaintiff, who was then their agent for the sale of said property for which said notes were given, and acting as such, guaranteed the payment of *19said notes in writing, which, but for said representations afore-1 said made by the defendant, and not knowing the contrary, this plaintiff would not have done so. (6) That thereafter this plaintiff paid the said machine company the amount of said notes, under said guaranty, and the same were by the said machine company duly assigned for value to him, who is now the owner thereof. (7) That the defendant has not paid the same, or any part thereof, except the sum of twenty dollars paid thereon in the spring of 1888. Wherefore plaintiff demands judgment against the said defendant in the sum of two hundred and fifty-three dollars ($253), with interest thereon from April 1, 1888, at ten per cent per annum, upon a debt incurred for property obtained under false pretenses, and for costs and disbursements of this action.’’ The defendant not appearing, judgment was rendered against him in the usual form, for the amount of the notes, interest, etc., and in which it is recited: '“‘And it further appearing, after due examination of all the evidence offered, that all the allegations in the complaint are true, and that said debt was incurred for property obtained under false pretenses: Now, therefore, * * * it is hereby ordered and adjudged that the plaintiff have and recover against the defendant the sum of * * * upon a debt incurred for property obtained under false pretenses, together with,” etc. The execution follows the judgment, and recites that an execution was duly issued against the property of the defendant, and had been returned unsatisfied, and concludes as follows: “Now, therefore, in the name of the state of South Dakota, we command you that you arrest said judgment debtor, I. N. Griffith, and commit him to the county jail of said Minnehaha county until he shall pay the aforesaid judgment, together with all costs, or be discharged according to law.” The petitioner states that he was illegally imprisoned for the following reasons: “First. That the judgment in said action, and upon which said execution issued, does not authorize the issuance of an execution against the body of your petitioner, for the reason *20that said judgment does not adjudge, and the complaint on which it is founded does not allege, that the defendant has been guilty of fraud in contracting the debt for which said action was brought. * * * Third. That no order of arrest was issued in said action prior to the judgment, and the allegations of the complaint to the effect that the debt was incurred for property obtained under false pretenses, not being material to plaintiff’s cause of action, do not authorize the arrest of defendant after judgment. Fourth. That the provisions of the statute authorizing the arrest of a defendant in an action arising out of, or founded upon, contract, are unconstitutional and void, being in contravention of Sec. 15, Art. 6, of the constitution.”
The sheriff contends, first, that the questions involved in this appeal were settled by this court in Sundback v. Griffith, 68 N. W. 544. But in this the appellant is in error. The questions involved in that case were entirely different from those involved in this case, and the decision in that case does not affect the present appeal. No order of arrest having been served before judgment in this case, it comes within the provisions of the last clause of Sec. 5115, Comp. Laws, which reads as follows: “But no execution shall issue against the person of a judgment debtor unless an order of arrest has been served as in this code provided, or unless the complaint contains a statement of facts_ showing one or more of the causes of arrest required by Sec. 4945.” This section, as well as 4945, referred to, is copied from Secs. 288 and 179 of the Code of' Civil Procedure of New York, as amended in 1882. In a very large proportion of cases in which the defendant may be arrested, the cause of action and cause of arrest are identically the same, and in such cases the cause of action stated in the complaint would necessarily make out a cause for arrest upon the judgment. The pleadings in such cases, therefore, would raise all the issues as to the liability of the defendant to arrest and imprisonment, The defendant would have an opportunity on the *21trial to contest and disprove the facts alleged by the plaintiff, which he could not do if the facts showing his liability to arrest were not necessarily stated in the complaint. Where, however, the cause for arrest does not necessarily appear in the complaint, the execution against the person is prohibited, unless an order of arrest is served before judgment, thereby giving the defendant an opportunity to disprove the charges made against him prior to the judgment. Wood v. Henry, 40 N. Y. 124; Elwood v. Gardner, 45 N. Y. 349; Prouty v. Swift, 51 N. Y. 594; Graves v. Waite, 59 N. Y. 156; Hormann v. Sherin (S. D.), 65 N. W. 434. It will be noticed that the plaintiff’s cause of action in the case at bar is based upon three notes executed by Griffith, and transferred by the payee to Sundback, the plaintiff in the action. The false pretenses alleged to have been made in order to obtain the machinery for which the notes were given constitute no part of the cause of action. Had the defendant, Griffith, appeared in the action, and denied the alleged false pretenses, no material issue would have been presented for trial to the court. The mingling with the allegations of the facts constituting a cause of action, statements of false pretenses, etc., do not bring the case within the provisions of Sec. 5115. The statements in the complaint of the false' pretenses were foreign to the cause of action, and had no proper place in the complaint. They were not issuable, and could not have been properly tried in the action, and they in no manner affected the plaintiff’s right to recover. If the defendant, Griffith, executed the notes, and had not paid them, then he was liable for the amount due upon them to the plaintiff, as the owner and holder of the same. The law in this class of cases is laid down with such clearness by Church, C. J., in Elwood v. Gardner, supra, that we copy from it at some length. He says: “An order of arrest may be obtained in both classes of cases — in those cases where the cause of action is identical with the cause of arrest, and in the actions where facts dehors the cause of action constitute the ground of arrest. In the lat*22ter class of cases, unless an order of arrest is obtained before judgment, no ca. sa. can issue. This process is, in effect, pro-prohibited by Sec. 288 above quoted. In such cases it is not necessary or proper to set forth the facts constituting the cause of arrest in the complaint, because they constitute no part of' cause of action, and are not relevant to it, and need not be proved on the trial. For instance, in an action upon contract, to recover a debt, it would be improper to set forth that the defendant had been guilty of fraud in contracting the debt, or that he had disposed of his property with intent to defraud his creditors. It is only proper to state in a complaint the facts necessary to the cause of action. In such a case an order of arrest must be obtained before judgment, to entitle the plaintiff to a ca. sa. * * * The meaning of the latter clause of Sec. 288, providing that a defendant shall not be arrested unless a complaint contains a statement of facts showing one or more causes of arrest, required by Sec. 179, is that the statement in the complaint must be of facts legitimately and properly in the complaint — such as are proper and necessary to be proved, or, in other words, such as constitute a cause of action for which a party may be arrested. It would be absurd, in an action on a promissory note, to allow a party, after judgment, to issue a ca. sa., without having obtained an order of arrest, merely by incorporating into the complaint a statement of facts sufficient to have authorized the order upon a motion. Such facts have no legitimate place in a complaint, unless they are pertinent to the cause of action; and, if they are, they should be proved on the trial.” In that case an order of arrest was served, but as the defendant acted upon the belief that the action was in fact one for fraud, in which he would have an opportunity to deny the fraud and have a trial of the issue, he omitted to move for his discharge from arrest under the order. On the trial, however, the plaintiff proceeded upon the theory that he had a good cause of action upon contract, and therefore abandoned his allegation for fraud, but claimed he had a right *23to imprison the defendant, for the reason that he had been arrested before judgment and had not obtained his discharge. This proceeding, the learned court held, constituted too sharp practice, and it affirmed 'the order of the lower court setting aside the execution issued against the body of the defendant,
Whether or not the facts alleged in the complanint as constituting the fraudulent representations by the defendant, Griffith, would have been available 'to the plaintiff, if embodied in an affidavit in a proceeding for obtaining an order of arrest, as laying a foundation for a remedy against the person of the defendant on the judgment recovered, it is not necessary now to decide. Appellant contends that, as there has been no appeal from the judgment, it is. conclusive, and cannot be attacked in the collateral proceeding of habeas corpus. This contention would be correct if the complaint stated a cause of action based upon the fraud of the defendant as the ground for the recovery of the judgment. But the cause of action disclosed by the complaint is one of contract, purely. The alleged false pretenses constitute no part of plaintiff’s cause of action. If all the allegations as to the alleged acts constituting the false representations were wholly omitted from the complaint, or stricken therefrom, a perfect cause of action would remain upon which the plaintiff would be entitled to a judgment. On habeas corpus the court or j udge may look into the record for the purpose of 'ascertaining whether or not the prisoner is legally held, and he is not confined to the execution or judgment, but may look into the whole record. This is made clear by Subd. 4, Sec. 7841, Comp. Laws.
We conclude that as the allegations in plaintiff’s complaint relating to the false pretenses were entirely unnecessary, and served no useful purpose, their insertion in the complaint, judgment, and execution conferred upon the plaintiff no right to issue an execution against the person of the defendant, and his detention thereunder was illegal, and he was properly discharged. Counsel for respondent contends that under Sec. 15, *24Art. 6, of our state constitution, his detention under the proceedings in the case was clearly illegal. But we do not deem it necessary to pass upon that question in this case, and we therefore express no opinion upon it. The order of the circuit court is affirmed.