Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Database Sequences

Sequences are a feature that some DBMS products implement to provide users with a mechanism to generate unique values - the Sequence ensures that each call to it returns a unique value. This is particularly important when the Sequence's result is used as a Primary Key. These can be generated with a schema for loading onto the DBMS server.

Sequences are provided so that database users are not forced to implement their own unique value generator. Not all DBMS products support Sequences; those that do not instead provide functionality for columns to be initialized with an incrementing value.

In Enterprise Architect, Sequences can be modeled in one of two ways:

  • As individual objects (the default method) or
  • As Operations in a container

Functionally the two methods result in the same DDL being produced. The main difference is visual - by having several Operations in one container, you have fewer elements and less clutter on the diagram.

Individual objects

Sequences modeled as individual objects are UML Classes with the stereotype «dbsequence»; you create these either:

  • Within the Database Builder or
  • By dragging the 'Sequence' icon from the 'Data Modeling' Toolbox pages onto a diagram

Add a Database Sequence using the Database Builder



See also


Open the Database Builder.

The Database Builder


Load or create a Data model.


Right-click on the Sequences Package and select 'Add New Sequence'.


Overtype the default name with the appropriate name for the Sequence, and press the Enter key.


Double-click on the new Sequence, or right-click on it and select 'SQL Object Properties'.

The 'SQL Object Editor' dialog displays.

Add a Database Sequence to a diagram



See also


Open your Data Modeling diagram and, if necessary, display the 'Data Modeling' page of the Diagram Toolbox (click on Search to display the 'Find Toolbox Item' dialog and specify 'Data Modeling').


Drag the 'Sequence' icon onto the diagram.

Database Sequence

This generates the Sequence element:

Database sequence element in Sparx Systems Enterprise Architect.


Right-click on the new Sequence element and select 'SQL Object Properties'.

The 'SQL Object Editor' dialog displays.

SQL Object Editor

The 'SQL Object Editor' dialog is shared by a number of SQL-based database objects (Views, Procedures and Functions); it helps you to manage the various properties of the SQL-based object.



See also


If it has already been set, the default database type displays.

If the default has not been set, or you want to change the database type for this Sequence, click on the drop-down arrow and select the target DBMS to model.

Set the Database Type


If necessary, type in a comment on the current Sequence.


Type the full SQL Sequence definition including the CREATE SEQUENCE syntax.

The code editor provides Intelli-sense for basic SQL keywords, functions and names of all objects in the current data model.

Options - Code Editors Intelli-sense

Operations in a Container

Database Sequences modeled as operations have a container object, this being a UML Class with the stereotype «sequences» (with an 's' on the end). Each Sequence is an operation with the stereotype «sequ». The system provides a dedicated Maintenance window through which the modeler can easily manage the Sequences defined as operations.

Sequences element in Sparx Systems Enterprise Architect.

Learn more