SQL Server 2012 identity problem (huge gaps after restarting server)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 Jahre weitere
Hello everyone.

There's any turn around to avoid this "problem" with sql server 2012?


I have just three customers on my table(excluding the guest customers) and the Id it's already on "2228".

I read that if we create Sequences with "No Cache" we can  avoid this problem.


Some guys already create scenarios explain the problem

http://www.dailymotion.com/video/xrkus9_bug-sequence-breaks-gap-numbers-after-restart-sql-server_school

http://www.big.info/2013/01/how-to-solve-sql-server-2012-identity.html

But in a nopcommerce way how could i avoid this?
10 Jahre weitere
No one else have this problem????

http://www.codeproject.com/Tips/668042/SQL-Server-2012-Auto-Identity-Column-Value-Jump-Is

http://connect.microsoft.com/SQLServer/feedback/details/743300/identity-column-jumps-by-seed-value#tabs

http://www.sqlserver-training.com/sequence-breaks-gap-in-numbers-after-restart-sql-server-gap-between-numbers-after-restarting-server/-
10 Jahre weitere
It would seem that using a Sequence instead of Identity is the only workaround at this time;

https://connect.microsoft.com/SQLServer/feedback/details/739013/failover-or-restart-results-in-reseed-of-identity

CREATE SEQUENCE s1 AS INT START WITH 1 NO CACHE;
CREATE TABLE t1 (Id INT PRIMARY KEY DEFAULT NEXT VALUE FOR s1, col INT NOT NULL);
10 Jahre weitere
So now, using nopcommerce with SQL Server 2012, we must create sequences to entire tables  to avoid this weird gap between the Ids?
10 Jahre weitere
And what about Entity Framework, it's already support sequences?
10 Jahre weitere
No one else had this problem?
10 Jahre weitere
It's seens to be a problem releated with AlwaysOn availability of SQL Server 2012 but i did not find a way to turn it back as usually works on the others version's.
10 Jahre weitere
Hi, this problem also troubled me, Have you found a solution to resolve it?
Almost all the Identity Increment with this issue in all tables.
9 Jahre weitere
Is there a good solution for this? My orderid just jumped from 7031 to 8000. I need it to be following orderids!
9 Jahre weitere
Try workaround mentioned above - using a Sequence instead of Identity
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.