Press "Enter" to skip to content

When Identity Columns Skip Values

Kevin Hill explains why you might see SQL Server skip 1000 values in an identity column:

Video shows a walk-through of before and after each fix, plus a “Two guys walk into a bar” joke when I disappeared to troubleshoot a broken demo…

I’d probably avoid the fix and live with gaps. You also get gaps when you roll back an operation which inserted into an identity column, or if you have merge replication enabled on a table keyed by an identity column and SQL Server bumps the range on you. All of these are normal and good reasons not to expect contiguous numbering.

One Comment

  1. Kevin
    Kevin2020-02-05

    Yep, you’re right…yet some people still have that expectation 🙂

Comments are closed.