Friday, October 19, 2012

SDF Database: Re Create objects if you missed setting primary key as identity

I was developing a demo application, as database I chose to add “.sdf” local database file. I added some columns and set primary key. Some how I forgot to set the identity property of primary key.

Went back to the same interface and try to modify the table schema and set identity property. End up with the following error.

image

I thought setting some property for instance “Prevent Saving changes that require table re-creation. In Options->Database Tools-> Table and Database Designers will do the job.

image

But it didn’t, Later what I did is very bad and didn’t feel any good about it. I cleared the table. Deleted the old ID field. And re-create the same ID column with right property again.

I would appreciate if any body help me on this issue to edit a primary key identity property without deleting or clearing the data.

No comments:

Post a Comment