HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Identity proceeds as normal, but with a leading 10...?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
leadingidentityproceedswithbutnormal

Problem

So I noticed a very strange thing when tinkering with my database.

I had just inserted a row which was ID 47, then after inserting some more, I realised that somehow my Identity had skipped all the way to 146, so it had skipped 999 to get there.

It's not a huge problem, or a gamestopper, just very strange, is there any way I can solve this? Short of backing up the data and recreating the table.

For the record, I didn't do anything at all between the data insertion - it seems to be totally random (of course it's not, something caused it I'm sure...)

Solution

This is a known behaviour difference in SQL Server 2012 because of a change in the way IDENTITY is implemented.

See related Connect Item for some discussion and possible workarounds (if this is a real issue for you)

Context

StackExchange Database Administrators Q#40669, answer score: 7

Revisions (0)

No revisions yet.