Ray's Asp.net Blog
Answers and code snippets from ASP.NET projects (Webforms/MVC/Classic ASP)
Pages
Event registration app with QR/Paypal
Home
Wednesday, November 6, 2013
How to fix "Cannot insert duplicate key in object . The duplicate key value is" problem while insert a new record in SQL Server?
First all, Run:
dbcc checkident([tablename],noreseed)
to check the latest id
Then run
DBCC CHECKIDENT ([tablename], reseed, latest id)
to correct latest id
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment