0

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

jon
  • 37
  • 2
  • 4

1 Answers1

3

There is no DBCC CHECKIDENT in SQL CE 4.

You need to use ALTER TABLE.

ALTER TABLE [MyTable] ALTER COLUMN [IdentityColumn] IDENTITY (999,1).

Darryl Peterson
  • 2,250
  • 1
  • 16
  • 13
  • 2
    Our organization has used this same command to support reseeding SQL Compact databases. Unfortunately, it will sometimes cause primary key constraint violations. In one case we had to DROP/CREATE instead. – Chris Schiffhauer Aug 07 '13 at 18:37