A. In any suit in equity or action at law, the contention that a pleading does not state a cause of action or that such pleading fails to state facts upon which the relief demanded can be granted may be made by demurrer. All demurrers shall be in writing and shall state specifically the grounds on which the demurrant concludes that the pleading is insufficient at law. No grounds other than those stated specifically in the demurrer shall be considered by the court. A demurrer may be amended as other pleadings are amended.
B. Wherever a demurrer to any pleading has been sustained, and as a result thereof the demurree has amended his pleading, he shall not be deemed to have waived his right to stand upon his pleading before the amendment, provided that (i) the order of the court shows that he objected to the ruling of the court sustaining the demurrer and (ii) the amended pleading incorporates or refers to the earlier pleading. On any appeal of such a case the demurree may insist upon his earlier pleading before the amendment, and if the same be held to be good, he shall not be prejudiced by having made the amendment.
Code 1950, §§ 8-99, 8-120; 1954, c. 333; 1977, c. 617; 2017, c. 755.