Where a demurrer to a complaint is made by one of several parties defendant upon the grounds that the complaint does not state facts sufficient to constitute a cause of action, or that causes of action are improperly united, the sufficiency of the complaint is to be tested as to the party demurring, and however insufficient it may be as to other parties, if it' states a cause of action as against the demurrant, and if as to him the causes of action are not improperly united, then his demurrer must be overruled.
However defective the complaint in this case may be as a complaint for the foreclosure of a mechanic’s lien, it seems to me that it states a cause of action against Reid & Company, against whom a personal judgment is demanded, and against whose property no lien is sought to be established.
The Code of Civil Procedure (§ 3412), provides that: “ If ’ the lienor shall fail, for any reason, to establish a valid lien *95in an action under the provisions of this title, he may recover judgment therein for such sums as are due him, or which he might recover in an action on a contract, against any party to the action.”
And it seems to me that if the complaint sets forth the same facts that would upon a trial entitle him to recover a judgment “ against any party to the action,” where he had failed “ to establish a valid lien ” that such complaint is as to that party sufficient, although it fails to set forth sufficient facts to enable the plaintiff “ to establish a valid lien.”
The causes of action united in this complaint are both upon contract, and both for work, labor and services. The first of which the complaint alleges the defendant Robert H. Reid & Company agreed to pay, and the second of which it is alleged was performed “ under a contract with Robert H. Reid & Company,” these are causes of action that can be united in a single complaint.
The demurrer must, therefore, be overruled with costs, ' with leave, however, to the défendant to plead over within twenty days upon the payment of such costs.
Demurrer overruled, with costs, with leave to defendants to plead over within twenty days upon payment of costs.