Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - SQL Usage » Creating Databases » Creating databases in SQL Anywhere » Tutorial: Creating a SQL Anywhere database


Lesson 4: Set a NOT NULL constraint on a column

In this lesson, you learn how to add a NOT NULL constraint on a column.

♦  To add and remove a constraint on a column
  1. In the left pane of Sybase Central, double-click Tables.

  2. Click MyProducts, and then click the Columns tab in the right pane.

  3. Select the ProductName column.

  4. From the File menu, choose Properties.

  5. Click the Constraints tab and select Values Cannot Be NULL.

    By default, columns allow NULLs, but it is good practice to declare columns NOT NULL unless there is a good reason to allow NULLs. See NULL value.

  6. Click OK.

    This constraint means that for each row added to the Products table, the ProductName column must have a value.

  7. From the File menu, choose Save.

See also