Automatic Key Generation

Adaptive Server Enterprise database driver for Perl supports an IDENTITY feature for automatic key generation.

Declaring a table with an IDENTITY column generates a new value for each insert. The values are monotonically increasing, but are not guaranteed to be sequential.

To fetch the value generated and used by the last insert:

SELECT @@IDENTITY

Sequence generators are not supported; use stored procedures to generate sequential identity values.