如何在SQL Azure的另一列上重新创建集群索引?

时间:2022-04-20 04:17:59

SQL Azure not only requires each table to have a clustered index, but also disallows DROP INDEX for clustered indices.

SQL Azure不仅要求每个表都有一个聚集索引,而且不允许对聚集索引进行删除索引。

Now I have a table which erroneously has a clustered index on column A and I want it to have a clustered index on column B instead.

现在我有一个表,它错误地在a列上有一个聚集索引,我希望它在B列上有一个聚集索引。

How do I create a clustered index on another column if dropping a clustered index is not allowed?

如果不允许删除聚集索引,如何在另一列上创建聚集索引?

2 个解决方案

#1


5  

Unfortunately, you can't.

不幸的是,你不能。

You'll have to create a new table with the same structure and correct clustered index, insert the data, drop the old table, and rename the new table.

您必须创建具有相同结构和正确聚集索引的新表,插入数据,删除旧表,并重命名新表。

#2


0  

I believe you can rebuild indexes in Navicat for SQL connected to Azure.

我相信您可以在Navicat中为连接到Azure的SQL重新构建索引。

#1


5  

Unfortunately, you can't.

不幸的是,你不能。

You'll have to create a new table with the same structure and correct clustered index, insert the data, drop the old table, and rename the new table.

您必须创建具有相同结构和正确聚集索引的新表,插入数据,删除旧表,并重命名新表。

#2


0  

I believe you can rebuild indexes in Navicat for SQL connected to Azure.

我相信您可以在Navicat中为连接到Azure的SQL重新构建索引。