Skip to main content

I'm exporting an ERD to SQL Server. The diagram consists of one entity with relationships to three other tables. Looking at the generated SQL the foreign keys are set up incorrectly. A FK that references table A for example uses the column that is the foreign key to table B.

Am I doing something wrong? Any way to fix this other than manually edit the generated SQL each time I export?

I found the problem. The relationships need to be connected to the corresponding table at the connection points for the corresponding columns. 

Issue resolved.


Hi Paul thanks for following up with that resolution! If anyone else is experiencing issues with ERD > SQL export feel free to post your question in this thread.


The query provided by Lucidchart import (ERD > SQL export) is not retrieving the foreign keys at all.  As a result the tables are not connecting with each other when I drag them into the doc.  I'm using a PostgreSQL DB and there are foreign keys defined in the schema for my DB.  Would appreciate any help in tweaking the query to pull the FKs.  Thanks!


Hi Yasir thanks for commenting in our community! You've provided some great information about the problems you are experiencing with our ERD import. I am going to have a member of our support team reach out with some more specific questions via email so we can take a deeper look. 


Reply