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 SQL Server 2005/2008 or Teradata 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 on the toolbar to create a new 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 upon creating a new (table-level only) table, this script will automatically be attached to it.

    Generate

    Lets you select whether or not to generate DDL for this object during Forward Engineering. If you do not select the check box, no DDL will 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