How do I copy records and their relational records too?

This is a discussion on How do I copy records and their relational records too? within the databases forums in Other Databases category; If I have a M2M set of tables (so three tables- two with real data, and one binding table in the middle). How do I make copies? table a: id, column1, column2... column50 table b: id, column1, column2... column50 table c: id, db_a_id, db_b_id I can't do insert...select because the keys will all be different on the newly copied tables. So how do I keep the binding in place? I'm guessing this is a common problem... I have mysql 5.0.22...

Go Back   Database Forum > Other Databases > databases

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 02-04-2008, 05:54 PM
Default How do I copy records and their relational records too?


If I have a M2M set of tables (so three tables- two with "real" data,
and one binding table in the middle). How do I make copies?

table a: id, column1, column2... column50
table b: id, column1, column2... column50
table c: id, db_a_id, db_b_id

I can't do insert...select because the keys will all be different on
the newly copied tables. So how do I keep the binding in place?

I'm guessing this is a common problem...

I have mysql 5.0.22


Reply With Quote
  #2  
Old 02-04-2008, 05:55 PM
Default Re: How do I copy records and their relational records too?

dterrors-at-hotmail.com wrote:
> I can't do insert...select because the keys will all be different on
> the newly copied tables.

Why?


Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 05:55 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Integrated by bbpixel2009 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.