gpt4 book ai didi

sql-server - 在插入操作之前禁用索引并在插入后启用返回索引的最佳方法

转载 作者:行者123 更新时间:2023-12-02 18:37:14 25 4
gpt4 key购买 nike

我计划在 SQL Server 2014 上创建非聚集列存储索引。

但是非聚集列存储索引是只读的,不能执行DML操作,我们需要在插入之前禁用并在插入之后重新启用。

执行此任务的最佳方法是什么?

最佳答案

只需禁用索引并执行重建即可。 https://msdn.microsoft.com/en-us/library/dn589806(v=sql.120).aspx

ALTER INDEX mycolumnstoreindex ON mytable DISABLE;  
-- update mytable --
ALTER INDEX mycolumnstoreindex on mytable REBUILD

关于sql-server - 在插入操作之前禁用索引并在插入后启用返回索引的最佳方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40553506/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com