0

I have a test database in SQL Server 2012. It has numerous tables with primary key columns of type int where the identity specification is set to yes and the Identity Increment and Seed are both set to one.

For some bizarre reason as I have been testing an application against this database many of these identity columns have suddenly gone from (for example) 9 to 1007. I know that I haven't called routines that would be trying to insert new rows which makes this behaviour all the more strange.

I'm curious as to whether anyone else has experienced this and if so do they know why it was happening?

Because it's a test database I'm not overly worried but I am concerned that new database deployed on an end users machine may exhibit the same quirky behaviour so I'd like to ensure that I have not inadvertently done something silly and set about correcting it if I have.

Thanks for any suggestions you may have.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Dom Sinclair
  • 2,458
  • 1
  • 30
  • 47
  • It is a bug and MS has not come up with a fix for it yet [Read here](https://connect.microsoft.com/SQLServer/feedback/details/739013/alwayson-failover-results-in-reseed-of-identity#details) – M.Ali Feb 11 '14 at 16:12

1 Answers1

1

This is probably to reseed of the identity upon database restart. You can find more information in this and this answers to related SO questions.

Community
  • 1
  • 1
jnovo
  • 5,659
  • 2
  • 38
  • 56