The TO NOT CLUSTER option drops the cluster attribute on the index name without affecting the physical table. Because no more than one clustered index can exist on a given table, you must use the TO NOT CLUSTER option to release the cluster attribute from one index before you assign it to another index on the same table. The following statements illustrate how to remove clustering from one index and how a second index physically reclusters the table:
CREATE UNIQUE INDEX ix_ord ON orders (order_num); CREATE CLUSTER INDEX ix_cust ON orders (customer_num); . . . ALTER INDEX ix_cust TO NOT CLUSTER; ALTER INDEX ix_ord TO CLUSTER;
The first two statements create indexes for the orders table and cluster the physical table in ascending order on the customer_num column. The last two statements recluster the physical table in ascending order on the order_num column.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]