Share via

Identity Column jumps massively from 168712 to 9999993

Perumal, Gowthami 5 Reputation points
2025-10-17T16:06:46.38+00:00

I have table with identity column id. There was massive jump from id 168712 to 9999993. It has happened twice in different servers. Its not identity cache/transaction rollback/manual insert/ reseed. Why its happening. Please guide me on this.

SQL Server | SQL Server Transact-SQL

Answer recommended by moderator

  1. Akhil Gajavelly 1,820 Reputation points Microsoft External Staff Moderator
    2026-01-02T10:32:41.6466667+00:00

    Hi @Perumal, Gowthami,

    Given SQL Server 2019 Enterprise and SIMPLE recovery, this behavior is by design.

    The only realistic cause of a jump from 168,712 to 9,999,993 is a failed or rolled-back large insert attempt from the application (bulk insert, batch insert, retry logic, background job, or parallel load). IDENTITY values are allocated up front and are never rolled back, even when the insert fails.

    This can happen without any manual intervention and without data actually being inserted.

    What it is not.

    • Recovery model
    • Corruption
    • Identity cache alone
    • SQL Server bug

    One final note is that,

    IDENTITY guarantees uniqueness, not continuity. Large gaps are expected under bulk/batch workloads.

    If the number must be sequential, use a SEQUENCE with controlled allocation or a separate business key.

    Thanks,
    Akhil.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Erland Sommarskog 133.9K Reputation points MVP Volunteer Moderator
    2025-10-18T16:45:53.7333333+00:00

    Why would you care? I mean, if you cared, why did you pick a column property that means "I don't care"?

    But apart from that, it is a little unexpected in so far that it does not seem to be due to the identity cache, since the cache is 1000 for int and 10000 for bigint.

    But it could be due to DBCC CHECKIDENT or inserts with SET IDENITITY_INSERT ON. You seem to rule out these, but it is not clear to me why you can be such sure.

    But may be most likely reason is a failed multi-row insert. If you attempt to insert 10 million rows, and this fails for some reason, you may consume 10 million IDENTITY values.

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.