Discovery Guide > Creating Views with Discovery > Creating a New Composite View from a Discovery Model
 
Creating a New Composite View from a Discovery Model
Discovery makes it easy for you to create a new composite view in TDV, based on relationships in a discovery model. All tables to be included in the new view must have at least one relationship to another table in the view. You can create a view based on a single relationship or on multiple relationships.
To create a new view based on a single relationship in a model
1. Open a model.
2. Select a relationship in the model.
3. Right-click and choose Create View Using Relationship from the pop-up menu.
Discovery opens a dialog for you to name the view and then displays the view in Studio.
To create a new view based on multiple relationships in a model
1. Open the model in Studio.
2. In the model Diagram, rearrange and edit the model as described in Working with Models in Discovery, and locate the resources that you want to include in the view.
3. Select the resources to include in the view, keeping these things in mind:
All tables should have at least one relationship to another table, unless you are creating a view from a single table that is unrelated to anything else.
Do not select any views; views cannot be included within a new SQL View.
To select multiple resources:
Ctrl+click the resources.
Hold down the left mouse button and draw a box around the resources.
Discovery displays the highlighted resources and makes the New View button available.
4. Click the New View button.
Discovery displays a dialog box for you to choose the location and name the view.
5. Choose the location and enter a view name.
Discovery creates the new view, opens it in the workspace. and adds it to the Studio resource tree.
Note: Creating a view can take awhile if the view and its SQL are complex.
Studio displays the new view in the Studio workspace on its own tab.
All resources and their relationships are defined. The SQL tabshows the SQL that Discovery created to define this view.
6. You can now use Studio’s extensive view editing capabilities to refine and publish the view.
See the TDV User Guide for information on views and publishing.