主键I上的聚簇索引 [英] clustered index on primary key I

查看:77
本文介绍了主键I上的聚簇索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在主键ID列上有聚集索引。现在我需要
drop clustered index(我想在另一列上创建新的聚簇索引),但是在ID列上保留主键。有可能吗?

如何?

i have clustered index on primary key ID column. Now i need to
drop clustered index (i want to create new clustered index on another column), but retain primary key on ID column. Is it possible?
How?

推荐答案

1。删除现有的主键

2.使用以下命令创建新的 - 非群集 - 主键:ALTER TABLE [表] ADD CONSTRAINT [PK_Name] PRIMARY KEY NONCLUSTERED(PK_Column)

3.创建其他 - 聚集 - 索引
1. Drop existing primary key
2. Create new - non-clustered - primary key, using: ALTER TABLE [Table] ADD CONSTRAINT [PK_Name] PRIMARY KEY NONCLUSTERED (PK_Column)
3. Create other - clustered - index


这篇关于主键I上的聚簇索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆