asp.net - Identity column increment jump -
this question has answer here:
i experiencing funny in database. primary key increases like:
1 2 3 4 5 6 7 8 1001
i'm using entityframework or linq sql.
it happens when sql server 2012 loses pre-allocated sequence numbers.
if want rid of that, 1 option use traceflag:
dbcc traceon (272)
another option use sequence (with no caching) instead of identity:
create sequence myseq int start 1 increment 1 no cache;
see this: http://www.big.info/2013/01/how-to-solve-sql-server-2012-identity.html
Comments
Post a Comment