Reputation: 8156
I'm building a basic CRUD page following beginner asp.net-core-mvc/ef-core tutorials
I've been noticing every time I rebuild and create a new record through my mvc site my Id's jump up 1000
Example, currently the id's for my first few rows are:
How do I stop this? I've never seen this behavior before. From some googling it seems to be a sql 2012 issue however I'm not using sql 2012.
I'm using mssqllocaldb, everything's updated and I have SSMS2014 installed
Upvotes: 9
Views: 3831
Reputation: 65870
Even though you have installed the SSMS 2014
, it doesn't install the 2014 local db
instance. It still can be a SQL 2012 local DB
. So my advice is to uninstall all old components and install the latest local db 2016
and SSMS 2016
. Both are free.
Here are the links :
SQL Server 2016 Express LocalDB
Additional Note :
Yes this is a bug on the SQL server 2012
.You can see it here :
Failover or Restart Results in Reseed of Identity
Workarounds :
If you need the Workarounds see the Workarounds
tab on the above link.
Permanent solution :
If you need a permanent solution, you can use a higher version of SQL server. Like SQL server 2014
or 2016
.You can select Free community editions
of those.
Upvotes: 6