Previous Topic: Define a View in SQL Server 2008Next Topic: Define a SQL Server 2008 View Column Expression


Define SQL Server 2008 View Columns

Use the SQL Server View Editor to specify the view columns in a SQL Server 2008 physical model. You can create view column references to any table column or view column in your model. By default, the view column name reflects the column name that the view references, but you can change a view column name. You can also reorder view columns, and create and manage view expressions, which are user-defined expressions that are stored as a view column.

To define SQL Server 2008 view columns

  1. Click Views on the Model menu.

    The SQL Server View Editor opens.

  2. Select the view in the Navigation Grid for which you want to define a view column.
  3. Click the Select tab and work with the following options:
    Available Tables and Views

    Displays the tables or views and associated columns that can be used to define the view column. Click the tables or views that you want and use the arrow buttons to move the selected items from this list over to the Columns list.

    Note: You control the tables and views that display in the Available Tables and Views list using the options in the From tab.

    Columns

    Displays the available columns in the selected view. You can move a selected column up and down in the list.

    Select Type

    Lets you select a view type that automatically eliminates duplicate rows.

    Restriction Type

    Lets you specify the With Check Option for the view column. This option ensures that data remains visible through the view after any changes are committed.

    Alias

    Lets you edit the alias of the selected view column.

    Expression

    Lets you edit the selected view column expression.

    Note: This option is available only if the selected view column is a user-defined expression.

    New

    Opens the New View Column dialog so you can add a new view column expression to the view.

    Delete

    Deletes the selected view column expression.

  4. Click Close.

    View columns are defined and the SQL Server View Editor closes.