There can be no question but what the appeal from the judgment brings up for review the order sustaining the demurrer upon which it is based. The statute so declares, whenever the order “involves the merits and necessarily affects the judgment.” Sec. 3010, R. S. This court has frequently so held. Breed v. Ketchum, 51 Wis., 166; Webster v. Ins. Co., 36 Wis., 67; Armstrong v. Gibson, 31 Wis., 61; Sweet v. Mitchell, 17 Wis., 125. The only ground of the demurrer is that the “ complaint does not state facts sufficient to constitute a cause of action.” Obviously the demurrer was not well taken, if the complaint does state facts sufficient to constitute a cause of action. That it *443does, seems to be conceded; but the contention is that it fails to state the facts necessary to entitle the plaintiff to a lien upon the premises in question for the amount of his claim, which is a part of the relief demanded. But the mere fact that the allegations of the complaint do not entitle the plaintiff to all the relief prayed for, is no ground for holding that it states no cause of action, when, in fact, it does state a good cause of action, for which judgment may be taken as a part of the relief demanded in the complaint. Such ground of demurrer can only be sustained when the complaint states no cause of action whatever. Bronson v. Markey, 53 Wis., 98: Wheeler v. Hall, 41 Wis., 447.
It is claimed, however, that an action to enforce a mechanic’s lien is made by the revised statutes an equitable action, and hence must necessarily state a cause for equitable relief. But the statute expressly provides that “if the plaintiff in any such action fail to establish his lien, . . . but establishes a right to recover upon contract for his alleged work and labor done, or materials furnished, he may have a personal judgment in the action against the party liable for the amount due him, ... in like manner as if the action were for the recovery of money only.” Sec. 3324, E. S. Thus, upon the conceded allegations of the complaint, the statute expressly authorized the plaintiff to take a personal judgment against the defendant for the amount due him, even assuming that be had failed to establish his lien, and yet, for that reason alone, judgment was ordered against him. We are clearly of the opinion that the order sustaining the demurrer was error. If the complaint contained matters irrelevant to the only cause of action alleged, the remedy was by motion and not by demurrer.
But does the complaint fail to state facts sufficient to entitle the plaintiff to a lien? The only defect alleged is *444that the claim for the lien, set out in full in the complaint, fails to state that the defendant had title to the land described. That fact is alleged in the complaint itself. The statute only requires that “ such claim for lien shall contain a statement of the contract, or demand upon which it is founded, the name of the person against whom the demand is claimed, the name of the claimant or assignee, the last date of the performance of labor or furnishing of materials, a description of the property affected thereby, a statement of the amount claimed, and all other material facts in relation thereto. It shall be signed by the claimant or by his attorney, and need not be verified, and may be amended, in case of action brought, by order of the court, as pleadings may be.” Sec. 3320, R. S. This section is more specific than the former statute, and the last clause did not appear in sec. 5, ch. 153, R. S. 1858. The words of the section relied upon as requiring such claim to state that the defendant had title to the lands described, are those in italics.
In Bertheolet v. Parker, 43 Wis., 551, it was held that the petition of a subcontractor for a lien must show with whom the original contract was made, and that such person had an interest in the premises affected by the proceedings. But in case of a subcontractor such statement is essential to connect him with the owner of the land and the premises. Such fact, together with the giving of the notice to the owner required by sec. 3315, R. S. (sec. 2, ch. 153, R. S. 1858), became, within the language of sec. 3320, R. S., “material facts in relation” to the lien. But in the case of a principal contractor the “statement of the contract,” with “the name of the person against whom the demand is claimed,” and “a description of the property affected thereby,” necessarily connects such contractor with the property and its owner.
In Willer v. Bergenthal, 50 Wis., 479, which was since the revision, this court went so far as to hold that the plaintiff was not required to prove the title of the defendant to the *445lot upon which the lien was claimed. The reason given was that the lien was enforceabie only upon his interest, and if he had none, then the plaintiff would take nothing by his judgment, thus likening the case to the foreclosure of a mortgage. If the claim or petition substantially conforms to the statutes, as above indicated, and the complaint substantially conforms to sec. 3322, R. S., it would seem to be sufficient, and here they do so conform.
By the Oowrt.— The judgment of the circuit court and the order upon which it is based are reversed, and the cause is remanded for further proceedings according to law.