If the amount due the contractor shall not be sufficient to pay all liens in full, the court shall order and direct the payment of the same, after deducting the costs of the action, to the persons whose liens are adjudged valid, ratably in proportion to the amounts of their several claims; and may render proper judgment against the contractor for any deficiencies.

The public body shall not be liable in any event for more than the amount due to the contractor under provisions of these statutes for any costs of the action.

Source: SL 1895, ch 133, § 4; RCCivP 1903, § 716; RC 1919, § 1663; SDC 1939, § 39.0904.