I have a situation in which I have several related/cascaded tables. Lets say all 1-to-many relationships cascading down table1, table2, table3, table4, etc. What I have are default rows in the tables. They start with 1 record in table1 and have 1 or more related records in other tables.
What I am looking for is an easy way to replicate the rows and create/maintain new primary keys for each. By maintain I mean, table1.ID1 is replicated, so now there is a table1.ID2 with all the rest of the columns being the same, only the ID has changed.
On top of that all its related rows in all the other tables are replicated and the foreigns keys/primary keys all point to the new ones.
So table2 would have a foreign key of table1.ID2 a primary key of say table2.ID#, and the rest of the columns in the table2 row being the same as the row replicated in table2.
I am being lazy and trying to get out of having to manage the ID's and creating a very long Stored Procedure.
I don't think this can be done, but am hoping I am wrong. Thanks in advance.