Refactor SQL script support

Issue: SPR-9531