Each witness shall receive, for each day's attendance before any court, board, or tribunal in any civil or criminal case twenty dollars and mileage at such rate as may be established pursuant to § 3-9-1. Such mileage is limited to each mile actually and necessarily traveled. In any criminal case involving violation of a state law, witness fees on the part of the state shall be paid by the proper county, and the fees of any material witness on the part of the defendant shall be paid by the county unless otherwise ordered by the court. In any case involving violation of an ordinance, the local unit of government passing the ordinance shall pay the witness fees unless otherwise ordered by the court.
However, no person may receive witness fees if serving a period of incarceration in a state, county, or municipal facility at the time that person appears as a witness.
SDCL 19-5-1