Page 1 of 1

Dump multiple tables with foreign keys

Posted: Fri 12 Jun 2009 06:25
by siik

I am trying to dump three tables from my database to file. I have used the tMSDump component which can backuptofile() and restorefromfile().
Table3 references table2, and table2 references table1.

Backuptofile() works fine.

The problem i am having is:

I cannot restorefromfile() in any order(table3 first/table1 first), because the TRUNCATE statement in the dump file always fails (which it should because it violates the FK rule).

So i cant really find a solution to dump these three tables into one file. I guess i need to

A: turn the FK constraint off before restoring or
B: Dump all tables at once (i.e. truncate all tables then restore in correct order - 1,2,3 so FK are preserved)

but i cant see an option for this in the TMSDump component. I am sure someone else wouldve had to do this before, so any help is appreciated.


Posted: Fri 12 Jun 2009 12:37
by Dimon
Thank you for your inquiry. At present SDAC does not support such functionality. We will investigate the possibility of adding this functionality in the near future. As soon as we solve this question we will let you know.

Posted: Wed 01 Jul 2009 08:12
by Dimon
We have added the TMSDump.Options.DisableConstraints property to dump multiple tables with foreign keys in the latest SDAC build (