Updated on 2023-12-01 GMT+08:00

Managing Constraints

Creating, dropping, and renaming constraints for a created table.

Constraints cannot be added to column-store tables.

Creating a Constraint

  1. Right-click the selected constraint of the table and select Create constraint.

    The Add New Constraint dialog box is displayed prompting you to add information about the new constraint.

    There are three options of constraint type: CHECK, PRIMARY KEY, and UNIQUE. For details, see Defining Table Constraints.

  2. Enter the Constraint Name, Check Expression, and click Add. You can view the added constraint in the corresponding table.

    Data Studio displays the status of the operation in the status bar.

    The status bar will show the name of the constraint if it has been provided in the Constraint Name field, or else the constraint name will not be displayed as it is created by database server.

Renaming a Constraint

Follow the steps below to rename a constraint:

  1. Right-click the selected constraint and select Rename Constraint.

    The Rename Constraint dialog box is displayed prompting you to provide the new name.

  2. Enter the constraint name and click OK. Data Studio displays the status of the operation in the status bar.

Dropping a Constraint

Follow the steps below to drop a constraint:

  1. Right-click the selected constraint and select Drop Constraint.

    The Drop Constraint dialog box is displayed.

  2. Click OK to complete the operation successfully. Data Studio displays the status of the operation in the status bar.