26-2-201. Court order to obtain deposition or attendance of prisoner. If the witness is a prisoner confined in a jail or prison within this state, an order for the witness's examination in the jail or prison upon deposition or for the witness's temporary removal and production before a court or officer for the purpose of being orally examined may be made as follows:
(1) by the court itself in which the action or special proceeding is pending unless it is a justice's court;
(2) by a justice of the supreme court or a judge of the district court of the county where the action or proceeding is pending if pending before a justice's court or before a judge or other person out of court.