create index (core)

Creates an index on one or more columns in a table.

Syntax

Transact-SQL Syntax

create [unique][clustered | nonclustered]
 index index_name
on [[database.]owner.]table_name(column_name
[, column_name]...)
[with {{fillfactor | max_rows_per_page} = x, ignore_dup_key, sorted_data,
 [ignore_dup_row | allow_dup_row]}]
[on segment_name]

ODBC Syntax

CREATE [UNIQUE] INDEX index_name
ON base_table_name
(column_identifier[ASC|DESC]
 [,column_identifier[ASC|DESC]]...)

Parameters

Examples

Usage

  • Adaptive Server/CIS sends the create index command to the DirectConnect server as a language event.

  • Columns of type bit, text, and image cannot be indexed.

  • You cannot create an index on a view.

  • These parts of the create index command are not recognized by transformation:
    • clustered | nonclustered
    • with fillfactor
    • max_rows_per_page
    • ignore_dup_key
    • sorted_data
    • ignore_dup_row | all_dup_row
  • on segment

  • The ODBC command ASC|DESC cannot be generated by transformation. Only ascending indexes can be created.