5.4 Editing Views

To create a new view, right-click the Views node under the connection node in Server Explorer. From the node's context menu, choose theCreate Viewcommand. This command opens the SQL Editor.

Figure 5.10 Editing View SQL

Editing View SQL

You can then enter the SQL for your view, and then execute the statement.

To modify an existing view, double-click a node of the view to modify, or right-click this node and choose theAlter Viewcommand from a context menu. Either of the commands opens the SQL Editor.

All other view properties can be set in thePropertieswindow. These properties are:

  • Catalog: TheTABLE_CATALOG.

  • Check Option: Whether or not theWITH CHECK OPTIONclause is present. For additional information, seeThe View WITH CHECK OPTION Clause.

  • Definer: Creator of the object.

  • Definition: Definition of the view.

  • Is Updatable: Whether or not the view isUpdatable. For additional information, seeUpdatable and Insertable Views.

  • Name: The name of the view.

  • Schema: The schema which owns the view.

  • Security Type: TheSQL SECURITYvalue. For additional information, seeStored Object Access Control.

Some of these properties can have arbitrary text values, others accept values from a predefined set. In the latter case, set the desired value with an embedded combobox.

The propertiesIs UpdatableandSchemaare read-only.

To save changes you have made, use eitherSaveorSave Allbuttons of the Visual Studio main toolbar, or pressControl+S.

Figure 5.11 View SQL Saved

View SQL Saved