Hi All,
Anyone know why a foreign key constraint would NOT be generated?
I have the version 5.4.8.1 of Toad Modeller for SQL Server 2008 R2 database.
Some of the relationships I have defined in my model are not getting generated as foreign key constraint
ALTER TABLE xyztable ADD CONSTRAINT relxyzfield FOREIGN KEY ([xyzfield) REFERENCES abctable ([abcfield]) ON UPDATE NO ACTION ON DELETE NO ACTION
I have compared the ones that are being generated and I can’t find anything different.
Thanks
Steve
Hi Steve,
If you are not generating all tables, make sure to check the Referential Integrity settings in DDL Script Generation - some relationships and foreign key constraints may not be generated if the child or parent table is not generated as well.
If the problem persists, please send us your model (lukas.knapek@quest.com) and we will look into it.
Regards,
Lukas
Hi Lukas,
Thanks for your quick response. I am generating all tables however in preparing screen shots of the various DDL generation screen to send to you I found that some of the relationships where not checked under the Select List - Relationships Tab. I honestly can’t remember ever visiting that specific tab so not sure how they got unchecked but solved the problem. So thanks for prompting me to look deeper
Take Care
Steve