If judgment be given for the applicant, he may recover the damages which he has sustained, as found by the jury or as may be determined by the court or referee, upon a reference to be ordered, together with costs; and for such damages and costs execution may issue; and a peremptory mandamus must also be awarded without delay. If judgment shall be for the defendant, costs in his favor shall be taxed as a part thereof.
SDCL 21-29-12