help.axcms.netAxinom Logo
Save Save Chapter Send Feedback
KB10034: How to update the Sequence if creating new keys manually
If you are creating new objects with keys in the database manually don't forget to change the sequence tables accordingly.


You created new objects in the database manually / with a script. Now if you create a new object from with, there is a conflict, because tries to use a key-value which is already in use.

CAUSES keeps track of the primary keys used in the database table called Sequence. If it is not updated, will use a wrong key.


Update the NextVal column in the Sequence-table manually. If, for example, you added some values to the table AxCategory, run this statement:

UPDATE dbo.[Sequence]
SET NextVal = (SELECT MAX(CategoryID)+1 FROM dbo.AxCategory)
WHERE [Name] = ’Category’

To ensure that does not use its cached values (table Sequence is cached for better performance), ensure that you restart the application (for example, by saving web.config).

APPLIES TO versions: all