# Generate DDL to name FKs?

**URL:** <https://forums.toadworld.com/t/generate-ddl-to-name-fks/2300>\
**Category:** Toad Data Modeler\
**Created:** [June 10, 2010, 11:43am UTC](https://forums.toadworld.com/t/generate-ddl-to-name-fks/2300 "2010-06-10T11:43:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deermouse](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@deermouse](https://forums.toadworld.com/u/deermouse)\
**Post date:** [June 10, 2010, 11:43am UTC](https://forums.toadworld.com/t/generate-ddl-to-name-fks/2300/1 "2010-06-10T11:43:25Z")

</div>

By default TOAD seems to generate DDL for foreign key relationships, with this syntax:

alter table XX  
add foreign key (colA)  
references table ZZ (colB)

But, I want to be able to explicitly NAME the FK constraint, hopefully using the name I’ve give n the relationship in the model! Something like

alter table XX  
add constraint XX\_good\_name  
foreig n key (colA)  
references table ZZ (colB)

Is it possible to configure the SQL generation tool to do that?

thanks in advance

---

<div class="post-metadata">

**Author:** ![Vaclav\_Frolik](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vaclav_frolik/32/12_2.png) [@Vaclav\_Frolik](https://forums.toadworld.com/u/Vaclav_Frolik)\
**Post date:** [June 11, 2010, 5:26am UTC](https://forums.toadworld.com/t/generate-ddl-to-name-fks/2300/2 "2010-06-11T05:26:04Z")

</div>

Hi,

can you send me a sample model to [modeling@quest.com](mailto:modeling@quest.com) please? I’d like to know what database system you use etc.

Thank you,

Vaclav

---

<div class="post-metadata">

**Author:** ![deermouse](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@deermouse](https://forums.toadworld.com/u/deermouse)\
**Post date:** [June 18, 2010, 12:52pm UTC](https://forums.toadworld.com/t/generate-ddl-to-name-fks/2300/3 "2010-06-18T12:52:46Z")

</div>

Well, the obvious answer is just to check the “Generate Constraint Names” option on the Detail Settings tab of the Generate DDL window.

thanks,  
DM
