I have a table with three columns ID, Name, Designation
where column ID
is a primary key and its Identity specification is enabled and it seeds by 1.
Suppose I have 10 rows in the table. In a sequence values of ID
column is in sequence
1,2,3......10.
and user deletes 10th row then inserts a new row I am inserting will be having 11 as the value of ID
column. How can I make to to increment last row value? I mean i want "10" as the value of new row as row before it will be having column ID
value as 9.
I don't want to use MAX
function of SQL Server, I want it to be auto incremented. Is there any way to achieve this?
P.S: i am using Entity framework to insert values in DB.