A question that keeps re-appearing in the forum is, how can I reseed/reset an IDENTITY column in SQL Server Compact, as no DBCC command is available. You can simply use a special syntax of the ALTER TABLE command to do this, as follows:
ALTER TABLE [MyTableName] ALTER COLUMN [Id] IDENTITY (1, 1)
This will make the value of the next generated IDENTITY value 1 and increment with 1. Notice that you do not specify the column type, only the IDENTITY specification.
2 comments:
Cool, I was just looking for this now. Thanks Erik!
Thank you! You sir are a lifesaver!
Post a Comment