Take the 2-minute tour ×  I posed a question about Denali
sequences here and another question about emulation of identity
columns in Oracle Global Tables here.  I always thought that I
could trust that identity values increment by constant
increments. On the other side, I know that using sequences I can
never be sure that there are not some gaps in them.  Is it time
to adapt to gaps in sequences or will it be better to stay with
identity columns in temporary tables?  share|improve this
question You need to adjust to gaps, and never believe that
auto-generated values have any meaning whatsoever. Use
ROW_NUMBER() /* x your constant increment */ OVER (ORDER BY
Sequence) if you want a proper "gapless sequence" at runtime,
but even this can be affected by DELETE operations between runs.
–  Aaron Bertrand Jul 19 '11 at 17:42  1 Answer 1  up vote 13
down vote accepted  You can't guarantee contiguous or
consecutive identity values in SQL Server     • Loading a temp
table doesn't guarantee consecutive values. Saying t