Change Sliding Index Column

I have a clustered index to index a table in a text column. I want to switch this column with another column, for example ID , how can I change the index?

I cannot refuse and recreate because it works on Azure and the table must have a clustered index all the time.

SQL command and syntax for modifying index columns in an index.

change the index?

+6
source share
2 answers

You cannot change a clustered index.

The only option is to drop it and recreate it using a new column.

In your case, you probably have to re-create the table with the new clustered index on the ID , and then copy the data.

+5
source

Try the following:

 create clustered index [your_index_name] on [your_table] ([ID]) with (drop_existing = on) 
+9
source

All Articles