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

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Adding, Changing, and Deleting Data » Data modification statements » Integrity checking

Integrity checking Next Page

Inserting duplicate data


For example, suppose you attempt to create a department, but supply a DepartmentID value that is already in use:

To do this, enter the command:

INSERT
INTO Departments ( DepartmentID, DepartmentName, DepartmentHeadID )
VALUES ( 200, 'Eastern Sales', 902 );

The INSERT is rejected because the primary key for the table would no longer be unique. Since the DepartmentID column is a primary key, duplicate values are not permitted.