Is there any way to edit the value of autoincrement column when a row is deleted.
Eg I hav a table in which indexNo is autoincrement and PK .
I entered 10 rows having values of indexNo 1,2,3----10
Now when I delete the 10th row and again insert a row then I get the value of indexNo 11 not 10 . and also 10 is missing there ..
I get the table sys.identity_columns in which the value for increment and last value
SELECT cast(last_value as integer)+cast(increment_value as integer)
WHERE object_id=(SELECT id FROM sys.sysobjects WHERE name='MYTable')
Is there any way that I can edit the last value (decrement by one ) on afterdelete trigger ..
as when I tried to edit this table sys.identity_columns it does not give permission..
or any other way to chang the lastvalue of autoincrement column
View Complete Post