0

为什么不能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.

有可能让它工作吗?

4

1 回答 1

2

请阅读以下文章: https ://msdn.microsoft.com/en-AU/library/ms187403.aspx

在计算列或索引视图上创建或更改索引时,SET ANSI_PADDING 必须为 ON。有关索引视图和计算列上的索引所需的 SET 选项设置的详细信息,请参阅 SET 语句 (Transact-SQL) 中的“使用 SET 语句时的注意事项”。

试试下面的语句:

SET ANSI_PADDING ON
ALTER INDEX [PK_MyIndex] ON [MyTable] REBUILD PARTITION=ALL WITH (FILLFACTOR = 90)
于 2016-05-13T00:35:49.140 回答