Previous Topic: Select the Tables and Views for a SQL Server 2008 View

Next Topic: Define a View Index in SQL Server 2008

Specify Properties for the WHERE Clause for a SQL Server 2008 View

Use the Where tab in the SQL Server View Editor to specify search conditions for queries against a view. The information you enter in the fields in this tab become the SQL code that is generated.

To specify the properties for the WHERE clause for a SQL Server view

  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 specify WHERE clause properties.
  3. Click the Where tab and enter the values for the WHERE clause for the selected view using the following fields:
    Where

    Defines the search condition that must be satisfied by the results of the query. The text you enter becomes the WHERE clause in the SQL code that is generated. The WHERE clause excludes rows that do not meet the search condition.

    Group By

    Defines the criteria to use to group rows returned by the query. The text you enter becomes the GROUP BY clause in the SQL code that is generated. The GROUP BY clause places the selected rows into one group for each unique value.

    Having

    Defines the search condition that is applied to each row group, and filter out rows that do not meet the specified search condition. The text you enter becomes the HAVING clause in the SQL code that is generated.

    Restriction

    Applies the With Check Option restriction to the WHERE clause.

  4. Click Close.

    The WHERE clause properties are specified for the selected view and the SQL Server View Editor closes.