An action in which security for costs is required by § 15-9-1, and has not been given, shall be dismissed on a motion and notice by the defendant at any time before judgment unless in a reasonable time to be allowed by the court such security for costs be given in an amount to be designated by the court.
SDCL 15-9-4