Reputation: 185
I have a Column with MaxCode name, in Mytable that filled before,now i want alter this column and set it type to identity that start with max number existing in column MaxCode
Upvotes: 1
Views: 91
Reputation: 3410
Use below code to reset seed value for Identity column
DECLARE @newSeed NUMERIC(10)
SELECT @newSeed = MAX(MaxCode) FROM Mytable
DBCC CHECKIDENT (Mytable, RESEED, @newSeed)
Upvotes: 1