Export data not taking foreign key relationships into account
Posted: Tue 18 Jul 2017 14:26
I am using the Export Data functionality in Studio to export my entire database data via a single SQL Script.
The challenge I'm finding is that some of my tables have foreign key relationships to other tables, but the script created isn't taking that into account - So, for example, I have Table B that has a foreign key to a column in Table A (which would mean Table A needs to be populated first), but the script has Table B being populated before Table A and, therefore, it is causing a SQL error due to the data not being present in Table A yet.
Any thoughts about how to ensure the "parent" tables are populated before the tables that rely on their data?
The challenge I'm finding is that some of my tables have foreign key relationships to other tables, but the script created isn't taking that into account - So, for example, I have Table B that has a foreign key to a column in Table A (which would mean Table A needs to be populated first), but the script has Table B being populated before Table A and, therefore, it is causing a SQL error due to the data not being present in Table A yet.
Any thoughts about how to ensure the "parent" tables are populated before the tables that rely on their data?