cancel
Showing results for 
Search instead for 
Did you mean: 

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

costa-b
Explorer
0 Kudos

Hello,

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.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

GeorgeMcGeachie
Active Contributor

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.

Answers (0)