Define a Pre & Post Script

You can use the Pre & Post Scripts dialog to add model-level and table-level prescripts and postscripts.

To define pre & post scripts

  1. Click Pre & Post Scripts, Model-Level or Table-Level on the Database menu.

    The Pre & Post Scripts dialog opens.

  2. Select the script and complete the following fields on the General tab:
    Model-level

    A model-level script is executed either before or after the schema generation script.

    Table-level

    A table level script is included either before or after the CREATE TABLE statement.

    Generate

    Generates the script to the schema when you forward engineer. Clear this check box to not generate the script to the schema.

    Pre-Creation

    Includes the expanded code for the script before all other statements in the schema script (model-level script), or to display the script before the CREATE TABLE statement in the schema generation script (table-level script).

    Post-Creation

    Includes the expanded code for the script after all other statements in the schema script (model-level script), or to display the script after the CREATE TABLE statement in the schema generation script (table-level script).

    You can complete the fields on the Code, Expanded tabs and then optionally select the Comment or UDP tab to add a comment or user defined property.

  3. Click OK.

    Your changes are saved and the Pre & Post Scripts dialog closes.

    Note: Click Cancel to close the dialog without saving your changes.

More information:

Add a New Pre & Post Script

View a Script for a Model, Table or View

Change the Order of Script Execution

Generate a Script to the Schema

Define the Pre & Post Scripts SQL Code

Define the Pre & Post Scripts Expanded SQL Code

Enter a Comment for a Pre & Post Script

Add a User Defined Property Value for a Pre & Post Script