Skip to Content

Setting foreign key constraint names when generating the physical model from a logical model


I have a logical model and when I generate the physical model I want to change the constraint names for the foreign keys to follow the pattern: FK_<child table>2<parent_table> followed by an optional _<field name> in case there are multiple relationships between the two tables. The rdbms is SQL Server 2008.

Is there a place where I could set this pattern?

One option is to create a vbs script that does this after the physical model is generated, but I wondered if there is another way so I don't have to run that script.


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 13, 2018 at 08:43 AM

    The pattern used to create FK constraint names is part of the database definition, which you can access via "Edit Current DBMS" on the Database menu. Make sure you're working on a copy of the database definition, not the one in C:\Program Files\SAP\PowerDesigner 16\Resource Files\DBMS, which could get overwritten when you upgrade. If you want everyone to use it, I suggest you check it in to the Library folder in the Repository.

    You'll find it in: Script\Objects\Reference\ConstName

    For example, for Sybase IG 5.2 it reads - FK_%.U8:CHILD%_%.U9:REFR%_%.U8:PARENT%

    It's actually a GTL template, so you can adjust to anything you like within the DBMS rules and the capabilities of GTL.

    Add comment
    10|10000 characters needed characters exceeded