Prev Next

Reset Auto Increments

Enterprise Architects models are natively stored in tables in a relational database and the tool uses the auto-increment feature of these database system to when inserting new rows in its system tables. There are a number of operations such as bulk imports and exports from XML files that can cause a table's auto-increment column to approach its largest allowed value. This topic explains how to correct this issues and to re-sequence the values in any affected tables .

Impacts

Impact Due To

Impact

See also

XML Export/Import

XML Export/Import can cause gaps in the numbering sequence of auto increment columns.

Each XML Import deletes rows from several tables; the import then adds rows starting from the largest previous value of the auto increment column.

Repeated XML imports can result in the value of the auto increment approaching the maximum value of the database datatype; for example, SQL Server's int datatype has a maximum value of 2,147,483,647.

Replication

Large auto increment values can also arise where the project originated as an EAP replica or design master.

The Jet engine assigns random values for auto increment columns with each XML Import into the project.

These random values can approach the maximum range of the repository data type, which could present a problem when the EAP project is transferred to a repository.

Replication

Access

Ribbon

Configure > Model > Integrity > Reset IDs

Re-sequence auto increment columns

Step

Action

1

Open the project.

2

Select the 'Reset IDs' menu option.

A dialog displays listing all non-empty tables that contain an auto increment or identity column.

  • The 'Rows' column shows the number of rows in the table
  • The 'Maximum ID' column shows the current maximum value of the auto increment column
  • The 'Action' column shows either 'No Action' or 'Reset', depending on how close the column value is to the datatype's maximum

Tables requiring a reset are automatically selected in the list.

3

Click on the Go button to reset the auto increment column values.

Notes

  • Connection to the project must be via a direct connection; IDs cannot be reset while the connection to the repository is via Pro Cloud Server
  • Project Auditing must be disabled before IDs can be reset
  • MySQL repositories will require re-starting of the MySQL server so that the reset auto increment columns start from the reset value
  • While strict not necessary, Sparx System would recommend that this task is performed when all users are not actively using the Project
  • Sparx System recommend that a backup of the Project should be done both before and after performing a Reset of Table Auto Increment columns
  • In the Corporate, Unified and Ultimate Editions of Enterprise Architect, if security is enabled you must have 'Check Data Integrity' permission to reset IDs

Learn more