Click here to Skip to main content
15,899,126 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Question:-(Identity Column value suddenly jump to 1000 in ms sql server).

i m using Sql Server 2008 R2
column is identity column(1,1) and primary

but this problem create online server(Example:- 1,2,3,4.......767,1767,1768...)

please help Solve this Problem guys.........
Posted
Comments
phil.o 31-Oct-13 4:38am    
Which problem? Why do you care about the values of your primary key? The only thing you should worry about is that referential integrity is preserved.
One thing that can explain this situation is that there are about 1000 records that have been inserted/deleted between 768 and 1766.

1 solution

The Identity function will increment every time anything is inserted even if you rollback within a transaction or delete the tailing rows (if you delete the last row with id of 1000 then insert a row you will get the id of 1001).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900