>Hi All,
>
>I've finally gotten around to retrofitting some older tables in my app with primary and foreign keys. Is there a method to "backfill" those tables with key values after they've been re-structured, avoiding the dreaded 'uniqueness of [key field] is violated' error? New installs aren't, of course, a problem. It's the existing installations that I'm referring to. My app uses VMP as a framework, and Stonefield DB toolkit.
>Thanks.
Add primary key fields is a three-step process:
1) Add the field, but don't mark it as Autoincrement or Primary Key.
2) Populate the field
3) Modify the field definition to make it a PK and, if you're using it, AutoIncrement.
For more on this topic and a broader discussion, this article I wrote may help:
http://www.tomorrowssolutionsllc.com/Articles/Retro-fitting%20Primary%20Keys.PDFTamar