共用方式為


View Object

未來的 Microsoft SQL Server 發行版本將不再提供此功能。請避免在新的開發工作中使用此功能,並計劃修改目前使用此功能的應用程式。

The View object exposes the attributes of a Microsoft SQL Server view table.

顯示目前物件的 SQL-DMO 物件模型

Properties

AnsiNullsStatus Property

Owner Property (Database Objects)

CreateDate Property

QuotedIdentifierStatus Property

ID Property

SystemObject Property

Name Property

Text Property

Methods

Alter Method

ListPermissions Method

Deny Method (Table, View)

ListUserPermissions Method

EnumDependencies Method

Remove Method (Objects)

ExportData Method

Revoke Method (Table, View)

Grant Method (Table, View)

Script Method

ListColumns Method

 

備註

SQL Server supports the definition of data views as tables. With the View object, you can:

  • Create a SQL Server view table.
  • Export data from a defined view table.
  • Generate a Transact-SQL script to re-create a view table.
  • Grant, deny, or revoke access to an existing SQL Server view table.
  • Remove a view table from a server running SQL Server.

The Name property of a View object references the name of a SQL Server view table. Its value is constrained by the rules constraining the name of a view table.

To create a new SQL Server view table

  1. Create a View object.

  2. Set the Name property.

  3. Set the Text property to the Transact-SQL SELECT statement defining the view table. For more information about valid SELECT statements for view table definition, see CREATE VIEW (Transact-SQL).

  4. Add the View object to the Views collection of a connected Database object.

ms135098.note(zh-tw,SQL.90).gif附註:
The View object is compatible with instances of SQL Server versions 7.0 and later. However, the View2 object extends the functionality of the View object for use with features that were introduced in SQL Server 2000.

請參閱

參考

View2 Object

說明及資訊

取得 SQL Server 2005 協助