Sybase AutoNumber/Identity Column Resetting
-
I've never seen this before. I'm working on a database where the AutoNumber/Identity ID column is being reset when the given table has no data in it and the Sybase Server (SQL Anywhere v7 to be exact) is restarted. Anyone have any advise as to why this is happening and how it can be corrected? Thank you in advance and happy holidays to all.
-
I've never seen this before. I'm working on a database where the AutoNumber/Identity ID column is being reset when the given table has no data in it and the Sybase Server (SQL Anywhere v7 to be exact) is restarted. Anyone have any advise as to why this is happening and how it can be corrected? Thank you in advance and happy holidays to all.
Are you doing TRUNCATE on the table? That could be one reason. "If the table contains a column defined as DEFAULT AUTOINCREMENT or DEFAULT GLOBAL AUTOINCREMENT, TRUNCATE TABLE resets the next available value for the column" Refer to: TRUNCATE TABLE statement [^]
The need to optimize rises from a bad design.My articles[^]