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.
Il y a 10 ans
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?
Il y a 10 ans
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/-
Il y a 10 ans
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);
Il y a 10 ans
So now, using nopcommerce with SQL Server 2012, we must create sequences to entire tables  to avoid this weird gap between the Ids?
Il y a 10 ans
And what about Entity Framework, it's already support sequences?
Il y a 10 ans
No one else had this problem?
Il y a 10 ans
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.
Il y a 10 ans
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.
Il y a 9 ans
Is there a good solution for this? My orderid just jumped from 7031 to 8000. I need it to be following orderids!
Il y a 9 ans
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.