DEV Community

Ulisses Meira
Ulisses Meira

Posted on

EF Core Identity field increment 1000 by insert

I had a problem with EF Core with identity field in SQL Server. When saved a register, the id value jumped to 1002, 2003.. and counting..

The solution was disable the IDENTITY_CACHE...

ALTER DATABASE SCOPED CONFIGURATION SET IDENTITY_CACHE = OFF
GO
More information here..

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay