Data Model Designer Scripts
In the Data Model Designer, scripts link a data model to global scripts. When a data model uses custom SQL objects—such as views, tables, or stored procedures—a global script should be created to generate those objects, and then attached to the specific data model. When the data model is exported, any related global scripts are exported with it. These scripts are executed automatically when the data model is imported.
important
You must define fields for the data model before attaching scripts.
When to execute scripts
- Creating custom SQL objects: Generate views or tables used by the data model.
- Updating dependent database objects: Modify SQL objects that the data model relies on.
- Synchronizing environments: Import or export a data model to keep environments aligned.
Execute scripts
- In Data Models and Views, right-click a data model and select Data Model Designer.
- On the Tools tab, click Data Model Scripts.
Or click Data Model Scripts in the toolbar. - In Global Scripts, select the script you want to execute and click the arrow to move it to Scripts to Execute. Hold Ctrl to select multiple scripts at once.
- To preview the script content, click the magnifying glass icon next to the script.
- (Optional) Use the up and down arrows to arrange scripts in execution order. Some scripts must be executed in a specific sequence.
- Click Execute.
- Select the target environment and click Ok.
- Enter any required parameters in the Parameters dialog.
- Click Run.
Review execution report
- In the Execution Report dialog, find the script you want to review.
- Click the success or error icon to open the script details.
- Review the execution results in the Report Preview window.
- Click Cancel when finished.
- Click Save.
- On the File tab, click Save Data Model.
Report Preview fields
| Field | Description |
|---|---|
| Environment Description | Name of the environment where the script ran. |
| Script Description | Text label identifying the script. |
| Server Type | Database server type where the script is intended to run (for example, SQLSERVER, ORACLE). |
| Script Content | Full SQL definition of the script to be executed. |
| Revert Script Content | SQL code used to undo the effects of the script. |
| Error Message | Details of any error encountered during execution. |
tip
Review scripts at any time by clicking Errors in the Execute Scripts dialog.