In an action to recover the possession of personal property, the judgment for the plaintiff may be for the possession, or for the recovery of possession, or the value thereof in case a delivery cannot be had, and of damages for the detention. If the property has been delivered to the plaintiff, and the defendant claim a return thereof, judgment for the defendant may be for a return of the property, or the value thereof in case a return cannot be had, and damages for taking and withholding the same.
SDCL 15-16-1