Scripts can be generated from the content of the ER Modeler (Forward Engineering), allowing conversion of the diagram into database commands and DDL. The resulting DDL can be imported via Aqua Data Studio's import command into another database or saved and shared as an SQL script. Generating Scripts from an ER Model works nearly the same as generating a script through right-clicking on an object in the Schema Browser, and selecting "Schema Script Generator."

Generating a Script from an ER Model

  1. Select Generate Script from the Tools Menu in the Menu Bar, or use the keyboard shortcut CTRL + SHIFT + G.
  2. Select what database, schema, and schema objects are to be generated from the diagram. Use the quick filter to focus a search on keywords or wildcards. Individual Object Types ( Tables, Views, and Indexes) and individual Objects can be selected. Click next.
  3. Modify the Options for the script. Save as a single file, one file per object, or choose to preview the script without generating any files. Choose the script location, encoding, platform, statement separator, object quoted identifier, CREATE generation, DROP generation, Include Descriptive Header, Include Blank Line Between Statements, Include Comments, Qualify Objects, and other options. Click next.
  4. View its status for errors and elapsed time as the script is being generated. If the script is generated successfully without errors, click close and browse through the operating system to the destination directory selected above to find the file. If "Preview" was selected in the "Save As" option, the Preview tab will open containing the resulting script with syntax highlighting as set under File > Options > Editors > SQL Editor

The generated script contains all of the database commands needed to generate the diagram within a database.

ER Model - Menu Bar - Tools -
Generate Script

ER Model - Generate Script Dialog

ER Model - Generate Script Dialog -
Options

ER Model - Generate Script Dialog -
Status

ER Model - Generated Script

ER Model - Generated Script -
Preview Tab

  • No labels