# Duplicate column name from relations

**URL:** <https://forums.toadworld.com/t/duplicate-column-name-from-relations/2630>\
**Category:** Toad Data Modeler\
**Created:** [January 25, 2012, 3:12am UTC](https://forums.toadworld.com/t/duplicate-column-name-from-relations/2630 "2012-01-25T03:12:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emad.elshirbiny\_859](https://avatars.discourse-cdn.com/v4/letter/e/e495f1/32.png) [@emad.elshirbiny\_859](https://forums.toadworld.com/u/emad.elshirbiny_859)\
**Post date:** [January 25, 2012, 3:12am UTC](https://forums.toadworld.com/t/duplicate-column-name-from-relations/2630/1 "2012-01-25T03:12:04Z")

</div>

Hi,

I have two master tables and one detail, company\_code column found in both master tables, when I create relation from master tables to detail table all column related to master tables primary keys goes to detail table so, “company\_code” come twice. is there any solution ?

Ex:  
master tables  
table1 key(company\_code, cost\_center)  
table2 key(company\_code,activity\_code)

Regards,  
Emad

---

<div class="post-metadata">

**Author:** ![admin1](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@admin1](https://forums.toadworld.com/u/admin1)\
**Post date:** [January 27, 2012, 1:52am UTC](https://forums.toadworld.com/t/duplicate-column-name-from-relations/2630/2 "2012-01-27T01:52:30Z")

</div>

Hi Emad,

There is an easy solution— Foreign Key Mapping. See Help | Model | Physical Data Model | Entity Relationship Diagram | Keys | Foreign Keys | FK Mapping topic and follow the instructions. As a result, there will be only one FK in the child.

Anyway, since the latest Beta release 4.2.2.7 you can set Automatic FK Mapping with several options. For more info see [Beta 4.2.2.7 Release Notes](http://modeling.inside.quest.com/servlet/KbServlet/download/4829-102-19809/Toad_Data_Modeler_4.2.2_BETA_Release_Notes.pdf).  
You can download the Beta at [http://modeling.inside.quest.com/ann.jspa?annID=150](http://modeling.inside.quest.com/ann.jspa?annID=150).

Anyway, I will delete the duplicate post of yours from the thread Unique key problem.

Regards,  
Lukas
