IBM Database Add-Ins for Visual Studio  

Check Constraints, Designer

In the Check Constraints view of the IBM Table Designer, you specify check constraints for the table. Check constraints are rules that specify the values that are allowed for every row in a table. Constraints are checked whenever data is inserted or updated.


List of Check Constraints
In this section, you manage the check constraints for the table and set their properties.
Check Constraints
Lists the constraints in the order that they will appear in the generated code. Type a name for the check constraint. This name can contain up to 18 characters and can be an ordinary identifier or a delimited identifier.
Check Constraint Properties
Set the property values for the check constraint that is selected in the Check Constraints list. An unavailable property is a limitation of the database that you are using.

Select a property to see its description in the box under the properties list. If the description exceeds the size of the box, hover the mouse pointer over the last line of text in the box. After a brief pause, the full description is shown in a ScreenTip.

Constraint Expression
In this section, you specify the expression for the check constraint that is selected in the Selected Check Constraint list. Check constraints are not checked for inconsistencies, duplicate conditions, or equivalent conditions. Therefore, contradictory or redundant check constraints can result in errors at run time.
For a DB2 database
The DB2 syntax for a check constraint is:  CHECK (check-condition)

Additional information is available in your DB2 documentation. You can also find information in DB2 SQL documentation that is available through The SQL Reference for Cross-Platform Development Web page on developerWorks.

To use the Visual Studio Query Builder to create a constraint that is an SQL expression, right-click in this editor, and then select Query Builder on the shortcut menu. When you close the Query Builder, the SQL code in the Query Builder is automatically pasted in this editor at the insertion point.

See Also

IBM Table Designer | Developing IBM Database Tables | Managing Procedures, Functions, and Objects


.NET Development Forum   DB2 FAQs   IDS FAQs

© Copyright IBM Corporation 2002, 2019. All Rights Reserved.