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 Views

A Database View represents the results of a pre-defined query. Unlike a Table, a View is dynamically derived from data in one or more Tables (or other Views). Enterprise Architect supports the definition of Views both with and without this statement:

     "Create View {viewName} As" statement

The system will automatically add it dynamically (if missing) whenever DDL generation is performed. The advantage of not defining this statement is that when a view object is renamed the 'View Definition' property does not have to be manually updated.

You can create a Database View either:

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

Add a Database View with the Database Builder



See also


Open the Database Builder.

The Database Builder


Load or create a Data model.


Right-click on the 'Views' Package and select 'Add New View'.


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


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

The 'SQL Object Editor' dialog displays.

Add a Database View 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 'View' icon onto the diagram.


This generates the View element:

View element in Sparx Systems Enterprise Architect.


Right-click on the new View 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, Functions and Sequences); it helps the data modeler 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 View, click on the drop-down arrow and select the target DBMS to model.

Set the Database Type


A list of objects that the current object depends on. The 'Dependencies' list shows:

  • Each Depends connector between this View and another Table or View
  • Any object names (specified as a CSV list) in the 'parents' Tagged Values


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


Type the full SQL View definition. For releases of Enterprise Architect up to 12.1 (Build 1227), this must include the CREATE_VIEW syntax as appropriate for the target DBMS (for later versions this is not needed). For example:

     CREATE VIEW 'MyViewName' AS

     [view definition]

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

Learn more