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

SQL Anywhere 12.0.0 (Français) » SQL Anywhere Server - SQL Usage » Ensuring data integrity » Using column defaults

 

The AUTOINCREMENT default

The AUTOINCREMENT default is useful for numeric data fields where the value of the number itself may have no meaning. The feature assigns each new row a unique value larger than any other value in the column. You can use AUTOINCREMENT columns to record purchase order numbers, to identify customer service calls or other entries where an identifying number is required.

Autoincrement columns are typically primary key columns or columns constrained to hold unique values. See Enforcing entity integrity.

You can retrieve the most recent value inserted into an autoincrement column using the @@identity global variable. See @@identity global variable.

 Autoincrement and negative numbers
 Autoincrement and the IDENTITY column
 See also