Toad World Blog

How to add Parent Table Name to FK columns at once

Dec 20, 2013 10:59:00 AM by Vaclav Frolik

There can be various reasons why all primary key attributes in your database structure should be named identically. 
The most typical name is "ID". But what if you start creating relationships?

In Toad Data Modeler all FK attributes are created automatically in child tables and because the names migrate as well, manual corrections might be necessary.

The following screenshot shows a sample of database structure where ID columns represent primary keys (in red) or foreign keys (in green).


All the foreign keys were added to child entities automatically and in many of the tables there are identically named attributes. Of course, this problem can be solved elegantly in Toad Data Modeler via Model Verification and the Quick Fixes feature that adds numbers/increments to the identically named objects.

In case you want to use parent entity name instead of numbers/increments do the following:

Download and install the Rename FK Columns package, restart Toad Data Modeler and then:

Select one or more relationships and choose Macros | Rename FK Column item to modify FK Column in child entity:


Or click Macros | Rename FK Column to modify all FK Column names in your model.


Result is displayed on the last screenshot.


Note: The macro adds Parent Entity Caption to FK Attribute Caption and Parent Entity Name to FK Attribute Name. 
You can switch between Caption and Names using combo box in Toolbar.

Good Luck!

Tags: Toad Data Modeler Data Modeling

Vaclav Frolik

Written by Vaclav Frolik


  • UX design and graphics
  • Databases
  • Product / Project management
  • Web technologies
  • Online marketing


  • Music bands: Pearl Jam, Audioslave, RHCP, Midnight Oil, Alter Bridge...
  • Actors: Kevin, Edward, Jack, Jeff and my kids.
  • Actresses: Kim, Jennifer
  • Sports: MTB, Squash, Football (the one played with feet, not hands)
  • Series: IT Crowd, The Big Bang Theory