【问题标题】:Unique Clustered Index - can I make non-unique without drop/create唯一聚集索引 - 我可以在不删除/创建的情况下使非唯一索引吗
【发布时间】:2013-07-12 16:46:49
【问题描述】:

我有一个导致复制问题的唯一聚集索引(请参阅“有界更新”)。除了删除聚集索引之外,有什么方法可以使索引不唯一?

【问题讨论】:

    标签: sql-server database-indexes


    【解决方案1】:

    聚集索引也是主键吗?如果聚集索引是主键,那么还会创建一个唯一的聚集索引。这意味着你必须放弃并创造。

    如果聚集索引不是主键,可以使用 with drop existing 来删除/创建索引。

    例如

    create clustered index MyIndex on MyTable(MyColumn[s]) with(drop_existing=on);
    

    【讨论】:

    • @adam_haines 不是,但表相当大。不过,总体而言,现有的下降值得一提。谢谢。
    猜你喜欢
    • 2011-04-17
    • 1970-01-01
    • 2014-11-04
    • 1970-01-01
    • 2014-01-09
    • 1970-01-01
    • 2019-10-28
    • 1970-01-01
    • 2010-10-09
    相关资源
    最近更新 更多