Renames indexes in base or global temporary tables, foreign key role names of indexes and foreign keys explicitly created by a user, or changes the clustered nature of an index on a catalog store table.
ALTER { INDEX index-name | [ INDEX ] FOREIGN KEY role-name | [ INDEX ] PRIMARY KEY | ON [owner.]table-name { rename-clause | move-clause | cluster-clause}
CREATE TABLE foo ( c1 INT IN Dsp1, c2 VARCHAR(20), c3 CLOB IN Dsp2, c4 DATE, c5 BIGINT, PRIMARY KEY (c5) IN Dsp4) IN Dsp3); CREATE DATE INDEX c4_date ON foo(c4) IN Dsp5; ALTER INDEX PRIMARY KEY ON foo MOVE TO Dsp8;
ALTER INDEX c4_date ON foo MOVE TO Dsp9
ALTER INDEX COL1_HG_OLD ON jal.mytable RENAME AS COL1_HG_NEW
ALTER INDEX FOREIGN KEY ky_dept_id ON dba.Employees RENAME TO emp_dept_id
The ALTER INDEX statement renames indexes and foreign key role names of indexes and foreign keys that were explicitly created by a user. Only indexes on base tables or global temporary tables can be renamed. You cannot rename indexes created to enforce key constraints.
The cluster-clause specifies whether the index should be changed to CLUSTERED or NONCLUSTERED. Applies to catalog store tables only and only one index on a table can be clustered.
Automatic commit. Clears the Results tab in the Results pane in Interactive SQL. Closes all cursors for the current connection.
SQL—ISO/ANSI SQL compliant.
Sybase—Not supported by Adaptive Server Enterprise.