Hi everyone,
I have two tables with a parent-child relationship. I would like to copy some of their records to two other tables, also with a parent-child relationship, but with a slightly different table structure.
There is a foreign key involved with both sets of tables, an integer column. All tables have the identity increment on for their primary key columns.
If I do a SELECT INTO
from the source parent table to the destination parent table, the primary key values for the destination records will be different from the source records, and the parent-child relationship will be lost.
Does anyone know how I can preserve this relationship during the copy, given that I'll have new primary key values in the new parent table? I'd prefer not to set the identity increment off for the new tables during this copy procedure, because there's no guarantee the primary key values in the source table won't already be in the destination.
Hope my description makes sense, and thanks for your opinions. Let me know if I can clarify further.