0
Answered

Is there a way to automatically move FK sql to the end of the scrip?

brian 1 year ago updated by Support 1 year ago 4

I am constantly creating 2 scripts, one to create tables with PK index's, then another to add FK index's. If I don't do it in that order I'll get errors because a Foreign key hasn't yet been created.



Perhaps I'm missing an an obvious way to get around this as I haven't seen anyone else bring this up.


In fairness my table structure isn't small or simple. I've attached a screen shot of the diagram below in case its helpful.



Answer

Answer

The tool is smart enough to order the tables properly so that there should not be any conflicts while generating SQL.

Can you please provide the exact "Error message" that you are receiving by running the generated Script?


Also, if it is fine, please share your DB Model with us (in Private message), so we can investigate further.


Answer

The tool is smart enough to order the tables properly so that there should not be any conflicts while generating SQL.

Can you please provide the exact "Error message" that you are receiving by running the generated Script?


Also, if it is fine, please share your DB Model with us (in Private message), so we can investigate further.


I swear this happened for the last two day, however when I just did it again to copy the error message  i didn't get one... Dang Murphy!


Fault alarm.


Thanks for the quick response.

Answered

I am glad it worked out.

Please feel free to contact us in case you have any further questions.