Boggs, Justice.In this appeal, we consider the application of OCGA § 9-11-4.1, providing for statewide certified process servers. The Georgia Association of Professional Process Servers and several of its members, who are private process servers, (collectively, “the Association”) filed this action seeking mandamus, declaratory judgment, and injunctive relief against the sheriffs of Fulton, Cobb, Gwinnett, DeKalb, Clayton, Forsyth, and Paulding Counties (collectively, “the Sheriffs”). In its petition, the Association alleged that the Sheriffs have conspired to thwart the use of certified process servers statewide, and have wrongfully failed to consider members’ individual petitions to become certified process servers under OCGA § 9-11-4.1, thus rendering the Code section null and of no effect. The Sheriffs responded that the Code section explicitly gives them the power to make a threshold decision whether to permit certified process servers to serve process in their counties. After discovery, the parties filed cross-motions for summary judgment. The trial court granted summary judgment in favor of the Sheriffs and denied the Association’s motion, finding that under a plain reading of the Code section, the Association was not entitled to any of the relief sought. From this order, the Association appeals.[1]The trial court should not have ruled on the merits of the Association’s claims for declaratory and injunctive relief against the Sheriffs in their official capacities, because those claims are barred by sovereign immunity. Accordingly, we vacate that portion of the trial court’s order and remand for dismissal. Because the trial court correctly granted summary judgment as to the Association’s other claims, we affirm the remainder of the trial court’s order.As the trial court correctly observed, the relevant provisions of OCGA § 9-11-4.1 are found in paragraph (a) and paragraph (h) (1):(a) Certified process servers. A person at least 18 years of age who files with a sheriff of any county of this state an application stating that the movant complies with this Code section and any procedures and requirements set forth in any rules or regulations promulgated by the Judicial Council of Georgia regarding this Code section shall, absent good cause shown, be certified as a process server. Such certification shall be effective for a period of three years or until such approval is withdrawn by a superior court judge upon good cause shown, whichever shall first occur. Such certified process server shall be entitled to serve in such capacity for any court of the state, anywhere within the state, provided that the sheriff of the county for which process is to be served allows such servers to serve process in such county.(h) Notice to sheriff.(1) Prior to the first time that a certified process server serves process in any county, he or she shall file with the sheriff of the county a written notice, in such form as shall be prescribed by the Georgia Sheriffs’ Association, of his or her intent to serve process in that county. Such notice shall only be accepted by a sheriff who allows certified process servers to serve process in his or her county. Such notice shall be effective for a period of one year; and a new notice shall be filed before the certified process server again serves process in that county after expiration of the one-year period.(Emphasis supplied.) The trial court found that the plain language of the statute barred declaratory and injunctive relief.[2] The court also found that mandamus is inappropriate because the members of the Association have an alternative course of action: “seeking appointments from the various courts of the State to become permanent process servers as provided in OCGA § 9-11-4 (c) (4).” Alternatively, it held that mandamus is not appropriate because the plain language of the statute gives the Sheriffs the discretion to choose whether to allow certified process servers, and the court cannot force them to do so.[3]Finally, the trial court denied appellants’ request for attorney fees. This appeal followed.1. Despite the ruling on the merits in the Sheriffs’ favor on the Association’s claims for injunctive relief and declaratory judgment, as a threshold matter for our analysis, it is important to note that the Sheriffs have raised the defense of sovereign immunity. To the extent applicable, this defense would preclude the trial court’s consideration of the merits of these claims. This Court has repeatedly ruled on the scope of sovereign immunity under the Georgia Constitution, finding that it bars claims for injunctive relief, Georgia Dept. of Natural Resources v. Center for a Sustainable Coast, 294 Ga. 593, 596 (2) (755 SE2d 184) (2014), and claims for declaratory judgment, Olvera v. Univ. System of Ga. Bd. of Regents, 298 Ga. 425, 427 (782 SE2d 436) (2016), even if based upon constitutional claims. Lathrop v. Deal, 301 Ga. 408, 425 (III) (801 SE2d 867) (2017).The Sheriffs raised the defense of sovereign immunity in their answers, but not in their joint motion for summary judgment.[4] However,[t]he applicability of sovereign immunity to claims brought against the State is a jurisdictional issue. Indeed, sovereign immunity [-] like various other rules of jurisdiction and justiciability [-] is concerned with the extent to which a case properly may come before a court at all. Therefore, the applicability of sovereign immunity is a threshold determination, and, if it does apply, a court lacks jurisdiction over the case and, concomitantly, lacks authority to decide the merits of a claim that is barred.(Citation, punctuation, and footnote omitted.) McConnell v. Georgia Dept. of Labor, __ Ga. __ (Case No. S17G1786, decided September 13, 2017.) A “court’s lack of subject-matter jurisdiction cannot be waived and may be raised at any time either in the trial court, in a collateral attack on a judgment, or in an appeal. [Cit.]” Abushmais v. Erby, 282 Ga. 619, 622 (3) (652 SE2d 549) (2007).Because the Association’s claims for declaratory judgment and injunctive relief are barred by sovereign immunity under Lathrop, Olvera, and Sustainable Coast, supra, the trial court should have dismissed those claims. We therefore vacate that portion of the trial court’s order and remand for further proceedings consistent with this opinion.[5]2. As we have noted before, however, “sovereign immunity is no bar to petitions for writs of mandamus. [Cit.]” Lathrop, supra, 301 Ga. at 434 (III) (C). We therefore consider whether the trial court erred in granting summary judgment on the merits with respect to the Association’s mandamus claims.“Mandamus is a remedy for improper government inaction — the failure of a public official to perform a clear legal duty. The writ of mandamus is properly issued only if (1) no other adequate legal remedy is available to effectuate the relief sought; and (2) the applicant has a clear legal right to such relief.” (Citations omitted.) Bibb County v. Monroe County, 294 Ga. 730, 734 (2) (755 SE2d 760) (2014). Pretermitting the existence of the first requirement, the trial court correctly found that the Association has failed to show a “clear legal right” to mandamus relief. With respect to this second requirement,[a] clear legal right to the relief sought may be found only where the claimant seeks to compel the performance of a public duty that an official or agency is required by law to perform. [F]or mandamus to issue, the law must not only authorize the act to be done, but must require its performance. Where performance is required by law, a clear legal right to relief will exist either where the official or agency fails entirely to act or where, in taking such required action, the official or agency commits a gross abuse of discretion. The determination of whether official action is required depends on the law governing the subject matter in question. Thus, where the applicable law vests the official or agency with discretion with regard to whether action is required in a particular circumstance, mandamus will not lie, because there is no clear legal right to the performance of such an act.(Citations and punctuation omitted.) Id. at 735 (2) (b). Moreover, when the law requires an official to exercise discretion, mandamus will lie to compel that discretion be exercised, but not to dictate the result:Where the act required by law to be done involves the exercise of some degree of official discretion and judgment upon the part of the officer charged with its performance, the writ of mandamus may properly command him to act, or, as is otherwise expressed, may set him in motion; it will not further control or interfere with his action, nor will it direct him to act in any specific manner.(Citations and punctuation omitted.) Id. at 736 (2) (b). In Bibb County, we held that, while mandamus would lie to compel the Secretary of State to comply with his statutory obligation to determine the true boundary line between two counties, it would not lie to dictate a particular location for that line. Id. at 738 (2) (b).Here, the Association asserts that the Sheriffs have “a clear legal duty” to permit the Association’s members to serve process once they have met the statewide qualifications under 9-11-4.1 (b). It contends that the trial court erred in holding that the Code section gives the Sheriffs “absolute discretion to permit or deny” certified process servers in their counties, as that “renders the Statute meaningless,” and that mandamus will lie “to require the Sheriffs to adhere to their clear statutory duty to review the Notices of Intent and allow qualified Certified Servers to serve process in their counties where the requirements for such service are met.” We disagree.When we consider the meaning of a statute, we must presume that the General Assembly meant what it said and said what it meant. To that end, we must afford the statutory text its plain and ordinary meaning, we must view the statutory text in the context in which it appears, and we must read the statutory text in its most natural and reasonable way, as an ordinary speaker of the English language would.(Citations and punctuation omitted.) Deal v. Coleman, 294 Ga. 170, 172-173 (1) (a) (751 SE2d 337) (2013). Here, a plain reading of the statute shows that each Sheriff is authorized to decide, as a threshold matter, whether to “allow[] certified process servers to serve process in his or her county.” OCGA § 9-114.1 (h) (1); see also OCGA § 9-11-4.1 (a). As the trial court correctly noted, that is a separate issue from the Sheriff’s duty to process applications for certification under OCGA § 9-11-4.1 (b). The Code section therefore is not “meaningless,” as process servers may be certified under OCGA § 9-11-4.1 (b), and may serve process in those counties which approve their employment.[6]Under these circumstances, the Association has failed to show that the Sheriffs violated any “clear legal duty” by exercising their statutorily-granted discretion to determine, as a threshold matter, whether certified process servers may act in their respective counties. The trial court therefore did not err in granting summary judgment to the Sheriffs on the Association’s petition for mandamus.[7]3. Because the Association did not prevail on its claims, the trial court correctly concluded that it was not entitled to attorney fees under OCGA 13-611. O’Connor v. Fulton County, __ Ga. __ (3) (Case No. S17A0880, decided September 13, 2017).Judgment affirmed in part and vacated in part, and case remanded with direction. All the Justices concur.