Previous Topic: Create an AnnotationNext Topic: Filter Objects in a Property Editor


Define Script Templates (Pre and Post Scripts)

You can use the Script Template Editor to create or modify script templates when you are working in a physical model, with any of the supported target databases defined as the target server.

To define script templates

  1. Click Pre & Post Scripts on the Database menu.

    The Script Template Editor opens.

  2. Select a script template and work with the following options:

    Note: Click New New icon in property editors to create a new object on the toolbar to create a script template.

    Name

    Specifies the name of the script template. Change the name of the script template in this field.

    Type

    Specifies to generate the script template for a model or a table.

    Generate As

    Specifies to generate the script template pre-creation or post-creation.

    Attach to New

    Specifies if you want to attach this script to all new (table-level only) tables.

    Generate

    Specifies whether or not to generate DDL for this object during Forward Engineering. If you do not select the check box, DDL will not be generated for this object during Forward Engineering.

  3. Review or assign code to the script template on the Code tab. Use the options on the Code tab toolbar to work with your text. Click the Macro Toolbox Macro Toobox icon to insert a pre-configured macro.
  4. Work with the other tabs in the editor to access additional features, for example:
  5. (Optional) Click the Comment tab and enter any comments you want associated with the script.
  6. (Optional) Click the UDP tab to work with user-defined properties for the script.
  7. Click Close.

    Your changes are saved and the Script Template Editor closes.

More information:

SQL Server Browser for Functions, Script Templates, and Stored Procedures

View Expanded Code in a Property Editor

Add a Comment in a Property Editor

Add a UDP in a Physical Property Editor