If, without material injury to the building or other improvement to which the lien holder has contributed, the same can be severed and removed from the land, the judgment, in the discretion of the court, may direct the sale of such improvement, with the privilege to the purchaser of removing the same at any time within sixty days, unless before such removal the owner or other persons interested in the land shall pay to the sheriff, for the purchaser, the amount realized from the sale, with interest and all expenses incurred toward such removal.
SDCL 44-9-46