3

enter image description here

I am using a simply add method from entity framework, this making me concerned, but i want to know if have any way to evade this jump, maybe this occur when server restart, I am not sure.

  • 2
    What's the query you're using to get those result sets? Is it `SELECT id_User FROM Table1 ORDER BY id_User DESC`? – squillman Jun 14 '13 at 18:31
  • 3
    Also what is the column definition? – Sam Axe Jun 14 '13 at 18:32
  • I don't know about EF, but other ORM's reserve a block of IDENTITY values to use locally on the client when performing their operations. If they never get used then you'll see these kind of jumps in the IDENTITY values. I would imagine EF could do this as well. But it looks like id_User is not an INT column if these results are all from the same table. – squillman Jun 14 '13 at 18:37
  • 8
    This is a known issue in SQL Server 2012 when restarting the service. If it actually is causing you a real problem (can't really see how it would) see the Connect item linked in the possible dupe. – Martin Smith Jun 14 '13 at 18:45
  • http://stackoverflow.com/questions/14146148/identity-increment-is-jumping-in-sql-server-database – Lucas Rodrigues Sena Jun 14 '13 at 19:23

1 Answers1

0

As Martin mentioned, this is a known (nasty!) issue since SQL Server 2012, which gave me headaches. If your solution depends on the id's i suggest you use the in SQL Server 2012 newly introduced Sequence mechanism. But be aware that this feature is not available in SQL Azure.

DoubleJ
  • 26
  • 3