vb6 msaccess sql
Suppose I merge two identical access tables with append query. How can I link it up with other tables? Since the primary key will be allotted fresh, how will the 开发者_如何转开发other related tables take up this primary key as its foreign key?
I would keep the original primary keys as "alternate keys", and add a new auto-numbered primary key to the resulting table (the merged one).
Then you'll need to drop the integrity rules on the tables with foreign keys into the original tables, and run updates on them to set their foreign keys to the value in the new primary key on the resulting table.
The re-establish the integrity rules between those tables and the resulting table, and drop the old alternate key and the old tables.
精彩评论