# Named  NOT NULL constraints?

**URL:** <https://forums.toadworld.com/t/named-not-null-constraints/37945>\
**Category:** Toad Data Modeler\
**Created:** [June 30, 2016, 3:05am UTC](https://forums.toadworld.com/t/named-not-null-constraints/37945 "2016-06-30T03:05:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThomasP](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/thomasp/32/101_2.png) [@ThomasP](https://forums.toadworld.com/u/ThomasP)\
**Post date:** [June 30, 2016, 3:05am UTC](https://forums.toadworld.com/t/named-not-null-constraints/37945/1 "2016-06-30T03:05:33Z")

</div>

Hello,

I’d like to derive the names for NOT NULL constrainst from the name of the table.

How can I configre TDM to let me edit names for NOT NULL constraints?

Thanks!

bye

Thomas

---

<div class="post-metadata">

**Author:** ![Lukas.Knapek](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/lukas.knapek/32/269_2.png) [@Lukas.Knapek](https://forums.toadworld.com/u/Lukas.Knapek)\
**Post date:** [July 1, 2016, 1:34am UTC](https://forums.toadworld.com/t/named-not-null-constraints/37945/2 "2016-07-01T01:34:03Z")

</div>

Hi Thomas,

The most easiest way is to use **Default Values** in combination with **Application Variables**. Go to **Settings Menu** | **Default Values** , in the tree to the left locate **Entities** | **Attributes** and look for **Constraint Not Null Name**.

![NNCC1.png](https://global.discourse-cdn.com/quest/original/2X/f/f74fbb0fc5da5eebbdf68329cf1bf6c68f091452.png)

Edit the value in **Default Value** column and create the name using some combination of text and Application Variables (from the selection on the right), e.g. _NC\_\<%TableName%\>\_\<%UniqueNumber%\>_.

 ![NNCC2.png](https://global.discourse-cdn.com/quest/original/2X/b/b4dab99089f51735cf86696021b8b7eef39b1280.png)

Apply the changes, restart TDM and you're done, from now on, every time a new **Not Null Constraint** is created, it will use the Default Value you have specified. This approach has one disadvantage - if you change the table name at some point, the changes won't be reflected in the Not Null Constraint name.

Another way to change the names is to use a script. You can try running the script attached to this post in **Expert Mode Menu** | **Scripting Window** (enable **Expert Mode** first in **Settings Menu** | **Options** | **General** ). The script should rename all of your Not Null Constrait Names to _NN __entity\_name_\__ attribute\_name_. \_Of course, you can modify the script to rename the objects to anything you want.

We have also created an enhancement change request ( **TDM-2369** ) to implement Application Variables evaluation directly for Not Null Constraints so your task could get a little easier in one of the future versions.

Regards,

Lukas  
[NotNullConstraintRename.txt](https://forums.toadworld.com/uploads/default/original/2X/3/35ec626468c0cb8534b59ec4adaa113987d5617d.txt) (966 Bytes)

---

<div class="post-metadata">

**Author:** ![Zaida](https://avatars.discourse-cdn.com/v4/letter/z/82dd89/32.png) [@Zaida](https://forums.toadworld.com/u/Zaida)\
**Post date:** [September 27, 2017, 4:36am UTC](https://forums.toadworld.com/t/named-not-null-constraints/37945/3 "2017-09-27T04:36:57Z")

</div>

Hello!

This has been implemented in version 6.3 which can be downloaded at [support.quest.com/…/download-new-releases](https://support.quest.com/toad-data-modeler/6.3/download-new-releases)

For more information about this release please have a look at the Releases Notes at [support.quest.com/…/technical-documents](https://support.quest.com/toad-data-modeler/6.3/technical-documents)

Thanks,  
Zaida
