There is nothing that guarantees it is, so the safe and correct answer is "no, this is not guaranteed".
What will happen in practice is that if the insert is executed as a non-parallel statement, it is highly likely that the physical order of the rows will match the sort order of the stored procedure. But the even more interesting twist is, of course, that there is no way of telling that this is the case using any SELECT
-- because any SELECT
that has no ORDER BY
does not guarantee the order itself, and any SELECT
that does have an ORDER BY
will sort the results regardless (it cannot know, and will not assume, that the rows are already in the desired order). If parallelism is involved and you have no ORDER BY
, the results can be rearranged even if they should happen to be in the "correct" order in the table.
So with that I'll come back to where we started and say "no, this is not guaranteed". Whenever you want results in a particular order, use ORDER BY
on retrieval. Worrying about the order on insertion is usually only relevant when you're doing bulk insert operations, and even then, it only matters for performance, not for the correctness of the results. If you find yourself writing any query where the order of a result is not completely enforced using ORDER BY
, and you are counting on that anyway, you're doing it wrong.