Share via


Indexes Collection

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 않도록 하고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The Indexes collection contains Index objects that reference indexes that implement Microsoft SQL Server constraints and user-defined access paths.

현재 개체를 보여 주는 SQL-DMO 개체 모델

주의

With the Indexes collection, you can:

  • Create a user-defined access path or unique constraint on data maintained by a SQL Server index.

  • Remove a SQL Server index.

For more information about creating a SQL Server index using SQL-DMO, see Index Object.

To remove a SQL Server index:

  • Use the Remove method of the Indexes collection, as in:

    oTables("Employees").Indexes.Remove("LastName")
    

When using the Item or Remove method, the Indexes collection supports member identification using either name or ordinal reference syntax. For example:

Set oIndex = oTable.Indexes("LastName")

Or

Set oIndex = oTable.Indexes(2)

[!참고]

Creating or removing indexes by using the Indexes collection requires appropriate privilege. The SQL Server login used for SQLServer object connection must be a member of the fixed role db_ddladmin or a role with greater privilege.