Correct output name for sql files+reliable order