问题
I want to run DBCC CHECKIDENT on a SqlCe4 database but it wont let me.
I need to reset the identity column as its messed up. I think because IDENTITY was turned off, an import of data was done and then IDENTITY turned on again so I guess its out of sync
回答1:
There is no DBCC CHECKIDENT in SQL CE 4.
You need to use ALTER TABLE.
ALTER TABLE [MyTable] ALTER COLUMN [IdentityColumn] IDENTITY (999,1).
来源:https://stackoverflow.com/questions/6284485/sql-ce-4-how-can-i-run-dbcc-checkident