主键是否总是群集? [英] Is primary key always clustered?

查看:70
本文介绍了主键是否总是群集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请清除我对此的怀疑,在SQL Server(2000及更高版本)中,主键是自动对群集索引的吗?还是我们可以选择在主键上使用非群集索引?

Please clear my doubt about this, In SQL Server (2000 and above) is primary key automatically cluster indexed or do we have choice to have non-clustered index on primary key?

推荐答案

不是,它可以是非集群的.但是,如果您没有明确将其定义为非聚集索引,并且表上没有聚集索引,则会将其创建为聚集索引.

Nope, it can be nonclustered. However, if you don't explicitly define it as nonclustered and there is no clustered index on the table, it'll be created as clustered.

这篇关于主键是否总是群集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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