Search code examples
auto-incrementsqlanywhere

SQL Anywhere autoincrement reset


I've got a SQL Anywhere 9 database, and I would like to reset the autoincrement value on one of my columns to a specific number.

I guess I need the SQL-Anywhere equivalent of:

ALTER TABLE foo AUTO_INCREMENT =100


Solution

  • Just so the answer is actually here, not just linked to:

    Use the sa_reset_identity system procedure:

    sa_reset_identity (
      [ table_name
      [, owner
      [, new_identity_value ] ] ]
    )