I\'ve created table with number like this: How to find gaps of data and insert NULL data points instead having gap
;WITH
Pass0 as (select 1 as C union all select
Rows in a table can not change their order because..... they do not have an order. The order of a set is not defined. Unless your select has an ORDER BY clause the order it is returned is random and can change even between two calls.
That is fundamental SQL.
You want an order, put an order into the SELECT statement.