Generate DDL for SQL Server 2008 - PERCodeGeneratorMS

When attempting to generate DDL for a model on SQL Server 2008, the generation fails at the Relationships step, and I’m greeted with a message of:

Source: Microsoft JScript run time Error
Script: PERCodeGeneratorMS
Description: ‘ForeignKeys.GetObject(…).AttrChild’ is null or not an object.
Row: 2224
Column: 5

(See the attachment for more information).

Not cool, as we just bought this tool due to Visio not being being able to generate DDL. Now it doesn’t work here???


Also, to note, I’m using version

Question - did you run a model check report? Sometimes tools will let you do things that make little sense, and can result in errors during DDL generation. For example making a mutli-column FK have some columns with NULL and some with NOT NULL would show up as an error during the model check report - and could easily cuase problems either during the DDL generation step or when you try to run the DDL.

The point: ALWAYS run the model verification reports as part of your moldeing emthodology …

By “model check report”, I’m assuming you mean a “Model -> Verify Model”.

Is this what you mean? (If so, then yes, I’ve ran the verify).


Please try to run also Test Model:

  1. Enable Expert Mode - Settings | Options | General | select the Expert Mode checkbox. Confirm OK.
  2. Right-click the model name in Model Explorer or Application View and select Test Model. See the messages in Message Explorer. What is returned?

You can also try to select the Repair Model option if some problems are returned after the Test Model.

In any case, please send us your model for further verification. Please send it to: Thanks very much!


Vladka + TDM Team

Hello Juan,

Unfortunately, we haven’t received any reply from you. Is it O.K. now?

Please let us know.

If the problem remains, please send us your model (to

Thanks very much!