46-21-101. When validity of sentence may be challenged. (1) A person adjudged guilty of an offense in a court of record who has no adequate remedy of appeal and who claims that a sentence was imposed in violation of the constitution or the laws of this state or the constitution of the United States, that the court was without jurisdiction to impose the sentence, that a suspended or deferred sentence was improperly revoked, or that the sentence was in excess of the maximum authorized by law or is otherwise subject to collateral attack upon any ground of alleged error available under a writ of habeas corpus, writ of coram nobis, or other common law or statutory remedy may petition the court that imposed the sentence to vacate, set aside, or correct the sentence or revocation order.
(2) If the sentence was imposed by a justice's, municipal, or city court, the petition may not be filed unless the petitioner has exhausted all appeal remedies provided by law. The petition must be filed with the district court in the county where the lower court is located.