ASA SQL Reference
SQL Statements
Use this statement to rename an index or foreign key, or to change the clustered nature of the index.
ALTER { index-spec { rename-clause | cluster-clause }
| foreign-key-spec { rename-clause | cluster-clause }
| primary-key-spec cluster-clause }
index-spec :
INDEX index-name ON [ owner.]table-name
foreign-key-spec :
[ INDEX ] FOREIGN KEY role-name ON [ owner.]table-name
primary-key-spec :
[ INDEX ] PRIMARY KEY ON [ owner.]table-name
rename-clause :
RENAME [ AS | TO ] index-name
cluster-clause :
CLUSTERED | NONCLUSTERED
rename-clause Specify the new name for the index.
cluster-clause Specify whether the index should be changed to CLUSTERED or NONCLUSTERED. Only one index on a table can be clustered.
The ALTER INDEX statement carries out two tasks:
It can be used to rename an index or foreign key.
It can also be used to change an index type from nonclustered to clustered, or vice versa.
The ALTER INDEX statement can be used to change the clustering specification of the index, but does not reorganize the data. As well, only one index per table can be clustered. For more information on clustered indexes, see CREATE INDEX statement.
Must own the table, or have REFERENCES permissions on the table, or have DBA authority.
Automatic commit. Clears the Results tab in the Results pane in Interactive SQL. Closes all cursors for the current connection.
SQL/92 Vendor extension.
SQL/99 Vendor extension.
Sybase Not supported by Adaptive Server Enterprise.
The following statement renames the index ix_prod_name on the product table to ixProductName:
ALTER INDEX ix_prod_name ON product RENAME TO ixProductName
The following statement changes ix_prod_name to be a clustered index:
ALTER INDEX ix_prod_name ON product CLUSTERED