为什么不能在具有PERSISTED NOT NULL
计算列的聚集索引上设置FILLFACTOR
?
查询设置FILLFACTOR
:
ALTER INDEX [PK_MyIndex] ON [MyTable] REBUILD PARTITION=ALL WITH (FILLFACTOR = 90)
错误:
ALTER INDEX failed because the following SET options have incorrect settings: 'ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.
有可能让它发挥作用吗?
请阅读以下文章:https://msdn.microsoft.com/en-AU/library/ms187403.aspx
创建或更改索引时,SET ANSI_PADDING必须为ON在计算列或索引视图上。有关的详细信息上具有索引视图和索引的必需SET选项设置计算列,请参阅"使用SET语句时的注意事项"在SET语句(Transact-SQL)中。
尝试以下语句:
SET ANSI_PADDING ON
ALTER INDEX [PK_MyIndex] ON [MyTable] REBUILD PARTITION=ALL WITH (FILLFACTOR = 90)