为什么可以在FILLFACTOR
个计算列的聚簇索引上设置PERSISTED NOT NULL
?
设置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.
是否有可能让它发挥作用?
答案 0 :(得分:2)
请阅读以下文章: 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)