Resetting seed of an identity column
Deleting last row and inserting record after will make a missing number for identity columns. This case we have to reset the id column. Use the following code to reset identity column.
Declare @mxCnt as int
Select @mxCnt= max( ID_Column ) from table_name
DBCC CHECKIDENT (table_name, RESEED,@mxCnt)

0 Comments:
Post a Comment
<< Home