无法在 SQL 服务器中的聚簇索引上指定 FILLFACTOR(ANSI_PADDING 错误)
Unable to specify FILLFACTOR on clustered index in SQL Server (ANSI_PADDING error)
为什么不能在具有 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 must be ON when you are creating or changing indexes
on computed columns or indexed views. For more information about
required SET option settings with indexed views and indexes on
computed columns, see "Considerations When You Use the SET Statements"
in SET Statements (Transact-SQL).
试试下面的语句:
SET ANSI_PADDING ON
ALTER INDEX [PK_MyIndex] ON [MyTable] REBUILD PARTITION=ALL WITH (FILLFACTOR = 90)
为什么不能在具有 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 must be ON when you are creating or changing indexes on computed columns or indexed views. For more information about required SET option settings with indexed views and indexes on computed columns, see "Considerations When You Use the SET Statements" in SET Statements (Transact-SQL).
试试下面的语句:
SET ANSI_PADDING ON
ALTER INDEX [PK_MyIndex] ON [MyTable] REBUILD PARTITION=ALL WITH (FILLFACTOR = 90)